home *** CD-ROM | disk | FTP | other *** search
/ MacWorld 2000 June (IDG) / Macworld_June_2000.iso / Shareware World / Utilities / Databasing / Troi-File-Plug-in2.0 / Overview.fp3 (.txt) < prev    next >
Encoding:
FileMaker Pro Database  |  2000-04-15  |  288.0 KB  |  2,602 lines  |  [FMP3/FMP3]

  1.  Copyright 1984-1998 FileMaker, Inc. 
  2. HBAM2016AUG95
  3. Pro 3.0
  4. HBAM3016AUG95@
  5. databaseA
  6. oserrrsA
  7. oserrrs
  8. databaseA
  9. plug-in
  10. plug-in
  11. Pro 3.0 - 4.0F!
  12. Pro 3.0 - 4.0M1
  13. Sunday
  14. Monday
  15. Tuesday
  16.     Wednesday
  17. Thursday
  18. Friday
  19. Saturday
  20. January
  21. February
  22. March
  23. April
  24. August
  25.     September
  26. October
  27. November
  28. December
  29. 1st Quarter
  30. 2nd Quarter
  31. 3rd Quarter
  32. 4th Quarter
  33. 4/3/00
  34. CONSIDERADITIONSLABELCALC
  35. CONSIDERATIONS
  36. DATEMODIFIED
  37. Function Overview
  38. Function Details
  39. Blank
  40. To PDF
  41. To PDF Copy
  42. PDF (index)
  43. PDF (overview)
  44. To PDF Copy
  45. Function OverviewB
  46. DESCRIPTION
  47. DESCRIPTIONTOTCALC
  48. DESCRIPTIONTOTVIEWCALC
  49. DEVELOPERID
  50. EXAMPLE1CALC
  51. EXAMPLE2CALC
  52. EXAMPLE2LABELCALC
  53. EXAMPLE2POSCALC
  54. EXAMPLEUSAGE
  55. FUNCTIONCATEGORY
  56. FUNCTIONID
  57. FUNCTIONINVERSION
  58. FUNCTIONMAC
  59. FUNCTIONNAME
  60. FUNCTIONNAMECALC
  61. FUNCTIONSAMPLE
  62. FUNCTIONSYNTAX
  63. FUNCTIONWIN
  64. GVERSION
  65. IMAGE1
  66. IMAGE2
  67. ISMASTERCALC
  68. MAXMODIFIED
  69. MODIFIEDTIME
  70. g    PAGECOUNT
  71. PAGENO
  72. PARAMETERLIST
  73. PLUGINNAME
  74. READY
  75. RELATEDFUNCTIONSID
  76. REMARK
  77. RESULT
  78. SPACEFORIMAGES
  79. SYNTAX
  80. URLCALC
  81. _1CALC
  82. _GNUMBER01
  83. _GPAGEOFFSET
  84. _GTEMP
  85. FunctionName
  86. FunctionMacB
  87. FunctionWinB
  88. FunctionSyntaxB
  89. FunctionIDB
  90. FunctionCategoryB
  91. FunctionInVersionB
  92. PluginNameB
  93. FunctionNameCalcB
  94.  "-" 
  95.  " ")
  96. DeveloperIDB
  97. RelatedFunctionsIDB
  98. FunctionSampleB
  99. SyntaxB
  100. DescriptionB
  101. ParameterListB
  102. ExampleUsageB
  103. ResultB
  104. readyB
  105. remarkB
  106. ConsiderationsB
  107. gVersionB
  108. DescriptionTotCalcB
  109. K & "
  110. ** " 
  111. M & "
  112. ** " 
  113. O & "
  114. ** " 
  115. R & "
  116. ** " 
  117. N & "
  118. DescriptionTotViewCalcB
  119. "DESCRIPTION
  120. PARAMETER(S)
  121. RESULT
  122. R ="" 
  123. SPECIAL CONSIDERATIONS
  124. R) & 
  125. EXAMPLE USAGE
  126. DESCRIPTION
  127. PARAMETER(S)
  128. RESULT
  129. SPECIAL CONSIDERATIONS
  130. EXAMPLE USAGE
  131. URLCalcB
  132. _gTempB
  133. ConsideraditionsLabelCalcB
  134. R ="" 
  135. Special Considerations
  136. Special Considerations
  137. _gPageOffsetB
  138. PageNoB
  139. isMasterCalcB
  140.  "External") >0
  141. ExternalG
  142. Example2PosCalcB
  143.  "EXAMPLE 2
  144. EXAMPLE 2
  145. Example1CalcB
  146. ^ = 0
  147. ^ - 1)
  148. Example2CalcB
  149. ^ > 0 
  150. ^ + 10
  151.  64000) 
  152. Example2LabelCalcB
  153. ^ > 0 
  154.  "Example 2" 
  155.  "" )
  156. V = "" 
  157. "<A HREF=""" &  
  158. V & """>" &  
  159. V & "</a>"
  160.     <A HREF="
  161. dA    pageCountB
  162. _gNumber01B
  163. DateModifiedB
  164. ModifiedTimeB
  165. MaxModifiedB
  166. _1CalcB
  167. image1B
  168. image2B
  169. spaceForImagesB
  170. version 2.0
  171.     Example 2
  172. Function DetailsB
  173. I$External Function Overview
  174. ABFD>>W
  175. Function nameZ
  176. Print`
  177. N.A. = Not Applicableb
  178. Plug-in Namep*See also the User Manual for more details.
  179.  1999-2000 Troi Automatiseringt
  180. detailsv
  181.     Find
  182. 7AgTIP You can find an up-to-date and comprehensive listing of all our External functions on our web site:
  183. http://www.troi.com/reference/
  184. External Function OverviewQ
  185. OverviewZ
  186. Print`
  187. N.A. = Not Applicable
  188. Nameg
  189. Winl+
  190.  1997-2000 Troi Automatisering,  <<
  191. ABFD>>m
  192.     Findq
  193. Syntax
  194. In version
  195. FindB
  196. OverviewW
  197. Function
  198. Namee
  199. Parametersf
  200. Descriptiong
  201. Category
  202. Function
  203. InVersion
  204. FunctionID
  205. PluginName
  206. DeveloperID
  207. RelatedFunctions
  208. Syntax
  209. Parameters
  210. Example
  211. Usage
  212. Result
  213. ready
  214. remark
  215. Special
  216. Considerations
  217. gVersion
  218. DescriptionTotCalc
  219. URLCalc
  220. _gPageOffset
  221. PageNo
  222. To  function details
  223. t    pageCount
  224. To PDF
  225. MaxModified
  226. image1
  227. spaceForImages
  228. BlankB
  229. Function Namee
  230. Parametersf
  231. Descriptionl
  232.  1997-1999 Troi Automatiseringn
  233. Cancelp
  234. Enter your search criteriar
  235. PluginName
  236. To PDFB
  237. I$External Function Overview
  238. ABFD>>Z
  239. To Overviews
  240.  1999 Troi Automatiseringv
  241.     Find
  242. To PDF CopyB
  243. ABCF>>
  244. Syntax         <<
  245. ABEK>>
  246. ABEL>>
  247. Parameters
  248. ABEN>>
  249. Returned result
  250. ABEP>>
  251. ABFK>>
  252. ABFC>>
  253. Example Usage
  254. ABFP>>
  255. ABGC>>
  256. ABGA>>
  257. Syntax         <<
  258. ABEK>>
  259. ABEL>>
  260. Parameters
  261. ABEN>>
  262. Returned result
  263. ABEP>>
  264. ABFK>>
  265. ABFC>>
  266. ABGN>>Example Usage
  267. ABFP>>
  268. ABGC>>
  269. ABGA>>
  270. ABFM>>L
  271. Function ReferenceM
  272. backN    <<
  273. ABCF>>P    <<
  274. ABCF>>
  275. ABFM>>L
  276. Function ReferenceM
  277. PDF (index)B
  278. ABCF>> xxx    <<
  279. ABFM>>
  280. PDF (overview)B
  281. ABCF>>        <<
  282. ABEL>>
  283.      DM`
  284. To PDF CopyB
  285. e#About error codes: OSErrrs Databasef
  286. 99999u
  287. OSErrrs Database
  288. D0001
  289. KuThis database contains most Windows and Macintosh Operating System error codes. It is downloadable from our web site.
  290. This database contains most Windows and Macintosh Operating System error codes. It is downloadable from our web site.
  291. V)http://www.troi.com/software/oserrrs.html
  292. Wa<A HREF="http://www.troi.com/software/oserrrs.html">http://www.troi.com/software/oserrrs.html</a>
  293. f    3/21/2000
  294. 3:48:29 PM
  295. About FileSpec
  296. Filesu
  297. Troi File Plug-in
  298. D0001
  299. Syntax         <<
  300. ABEK>>
  301. ABEL>>
  302. Parameters
  303. ABEN>>
  304. Returned result
  305. ABEP>>
  306. ABFK>>
  307. ABFC>>
  308. Example Usage
  309. ABFP>>
  310. ABGC>>
  311. ABGA>>
  312. ABFM>>L
  313. Function ReferenceM
  314. backN    <<
  315. ABCF>>P    <<
  316. ABCF>>
  317. Syntax         <<
  318. ABEK>>
  319. ABEL>>
  320. Parameters
  321. ABEN>>
  322. Returned result
  323. ABEP>>
  324. ABFK>>
  325. ABFC>>
  326. Example Usage
  327. ABFP>>
  328. ABGC>>
  329. ABGA>>
  330. TrFile-AppendContentsf
  331. textj
  332. Filesu
  333. Troi File Plug-in
  334. D0001
  335. J?Set Field [ result, External("TrFile-AppendContents", "text" )]
  336. KeAppend characters to the contents of an existing file indicated by the 
  337. SetDefaultFileSpec
  338.  function.
  339. MItext: the characters that you want to add at the end of the default file.
  340. Assume your C disk already contains a file "Testtext.txt", which contains the text "Hello". We assume that a global number field gErrorCode is defined. In ScriptMaker create the following script:
  341.     Set Field[gErrorCode, External("TrFile-SetDefaultFileSpec", "C:\Testtext.txt" )]
  342.     If [gErrorCode = 0]
  343.         Set Field[gErrorCode, External("TrFile-AppendContents", " there." )]
  344.     Endif
  345. This script will add  the text " there."  to the end of the file. After running the script once the file will conta
  346. To be able to specify a file, the plug-in uses FileSpec, which is short for File Specification. 
  347. On Windows this is always a full path like: 
  348.      "C:\Data Files\Database\Test.Txt". 
  349. On Mac OS the file spec can be a full path like this:
  350.      "Mac HD:Data Files:Database:testfile"
  351.  or it can be a FSSpec: 
  352.     ":volumeID:directoryID:fileName"
  353. The plug-in recognizes the FSSpec by the colon as the first character. 
  354. An example may be: ":-1:300:testfile".
  355. On the Mac a volume name need not beB  unique, be careful with that.
  356. On the Mac a disk name need not be unique, be careful with that.
  357. To be able to specify a file, the plug-in uses FileSpec, which is short for File Specification. 
  358. On Windows this is always a full path like: 
  359.      "C:\Data Files\Database\Test.Txt". 
  360. On Mac OS the file spec can be a full path like this:
  361.      "Mac HD:Data Files:Database:testfile"
  362.  or it can be a FSSpec: 
  363.     ":volumeID:directoryID:fileName"
  364. The plug-in recognizes the FSSpec by the colon as the first character. 
  365. An example may be: ":-1:300:testfile".
  366. On the Mac a volume name need not beBw unique, be careful with that.
  367. On the Mac a disk name need not be unique, be careful with that.
  368. 4/3/2000
  369. 3:51:57 PM
  370. TrFile-ContentsDialogf
  371. FileSpecj
  372. Filesu
  373. Troi File Plug-in
  374. D0001
  375. JQSet Field [ result, External("TrFile-ContentsDialog", "prompt | initialFolder" )]
  376. Shows the user a file selection dialog, the contents of the selected file is returned.
  377. This function is a combination of "TrFile-Get FileSpec Dialog" followed by a "TrFile-GetContents" function. 
  378. prompt:     adds a prompt text to the GetFile Dialog. It may be left empty.
  379. initialFolder:    (optional) the FileSpec or path to the folder where the dialog initially starts.
  380. in "Hello there.". If you run the script again the file will contain "Hello there. there."
  381. EXAMPLE 2
  382. This shows how to write to a log file. We assume that in your FileMaker file the following fields are defined:
  383.   gErrorCode        Global, number        gXplatformReturn    Global, text
  384.   gLogFilePath        Global, text          gLogtext        Global, text 
  385. gLogFilePath should contain the path to an existing log file, for example "D:\Logs\L2000_01.TXT" (Windows) or "Mac HD:Logs:Log 2000_01" (Mac). gXplatformReturn s
  386. hould contain a return on Mac and a return and a linefeed on Windows. gLogtext is the text you want to log. In ScriptMaker add the following scriptstep to your startup script:
  387.    Set Field[gErrorCode, External("TrFile-SetDefaultFileSpec", gLogFilePath )]
  388. This will set the default file to your log file. Then whenever you need to write a line to the log fill the field gLogtext and perform this script step:
  389.     Set Field[gErrorCode, External("TrFile-AppendContents",   
  390.         DateToText(Status(Cu
  391. hrrentDate)) & " " &
  392.         TimeToText(Status(CurrentTime)) & " text: " & gLogtext & gXplatformReturn))]
  393. This script step will add a line every time this script is performed. The log file might look like this:
  394. 12/31/2000 10:23:56 text: user peter logged in
  395. 12/31/2000 14:31:02 text: user peter logged out
  396. 12/31/2000 14:31:02 text: closed file "Invoices.fp5"
  397. etc...
  398. oThe returned result is an error code. An error always starts with 2 dollars, followed by the error code. You should always check for errors. Returned error codes can be:
  399.     0    no error       The string of characters were added to the file
  400.     $$-1      genericErr    The file could not be opened for appending (You might need to create the file first).
  401. Other errors may be returned.
  402. Use the function "TrFile-SetDefaultFileSpec" first to set the default file. See also the functions:
  403. "TrFile-Save FileSpec Dialog" to ask the user for a FileSpec,  "TrFile-SetDefaultFileSpec" to indicate the file to affect.
  404. Append characters to the contents of an existing file indicated by the 
  405. SetDefaultFileSpec
  406.  function.
  407. ** text: the characters that you want to add at the end of the default file.
  408. ** The returned result is an error code. An error always starts with 2 dollars, followed by the error code. You should always check for errors. Returned error codes can be:
  409.     0    no error       The string of characters were added to the file
  410.     $$-1      genericErr    The file could not be opened for appending (You might need t
  411. o create the file first).
  412. Other errors may be returned.
  413. ** Use the function "TrFile-SetDefaultFileSpec" first to set the default file. See also the functions:
  414. "TrFile-Save FileSpec Dialog" to ask the user for a FileSpec,  "TrFile-SetDefaultFileSpec" to indicate the file to affect.
  415. ** Assume your C disk already contains a file "Testtext.txt", which contains the text "Hello". We assume that a global number field gErrorCode is defined. In ScriptMaker create the following script:
  416.     Set Field[g
  417. ErrorCode, External("TrFile-SetDefaultFileSpec", "C:\Testtext.txt" )]
  418.     If [gErrorCode = 0]
  419.         Set Field[gErrorCode, External("TrFile-AppendContents", " there." )]
  420.     Endif
  421. This script will add  the text " there."  to the end of the file. After running the script once the file will contain "Hello there.". If you run the script again the file will contain "Hello there. there."
  422. EXAMPLE 2
  423. This shows how to write to a log file. We assume that in your FileMaker file the following fields are de
  424. fined:
  425.   gErrorCode        Global, number        gXplatformReturn    Global, text
  426.   gLogFilePath        Global, text          gLogtext        Global, text 
  427. gLogFilePath should contain the path to an existing log file, for example "D:\Logs\L2000_01.TXT" (Windows) or "Mac HD:Logs:Log 2000_01" (Mac). gXplatformReturn should contain a return on Mac and a return and a linefeed on Windows. gLogtext is the text you want to log. In ScriptMaker add the following scriptstep to your startup script:
  428.    Set Field[gErrorCode, Externa
  429. l("TrFile-SetDefaultFileSpec", gLogFilePath )]
  430. This will set the default file to your log file. Then whenever you need to write a line to the log fill the field gLogtext and perform this script step:
  431.     Set Field[gErrorCode, External("TrFile-AppendContents",   
  432.         DateToText(Status(CurrentDate)) & " " &
  433.         TimeToText(Status(CurrentTime)) & " text: " & gLogtext & gXplatformReturn))]
  434. This script step will add a line every time this script is performed. The log file might look like this:
  435. 31/2000 10:23:56 text: user peter logged in
  436. 12/31/2000 14:31:02 text: user peter logged out
  437. 12/31/2000 14:31:02 text: closed file "Invoices.fp5"
  438. etc...
  439. 4/3/2000
  440. 4:13:56 PM
  441. TrFile-CopyFilef
  442. 1i&source FileSpec | destination FileSpecj
  443. Filesu
  444. Troi File Plug-in
  445. D0001
  446. J[Set Field [ result, External("TrFile-CopyFile", "source FileSpec | destination FileSpec" )]
  447. K$Copies a file to the specified path.
  448. source FileSpec:     the Filespec or path to the file to copy.
  449. destination FileSpec:     the Filespec or path where the file must be copied to.
  450. Assume your C disk already contains a file "Testtext.txt". We assume that a global number field gErrorCode is defined. In ScriptMaker create the following script:
  451.     Set Field[gErrorCode, External("TrFile-CopyFile", "C:\Testtext.txt|D:\MyFiles\TestDupl.txt" )]
  452. This script will copy the file "Testtext.txt"  to  the "TestDupl.txt" file in directory "MyFiles" on the D: disk. On Mac OS the paths will be of the form "Mac HD:MyFiles:TestDupl.txt".
  453. EXAMPLE 2
  454. We assume that in your FileMaker 
  455.     Set Field [ result, External["TrFile-ContentsDialog", "Please select the text file you want to be used:|D:\DataFiles\" )]
  456. You can also use a calculation for the prompt, for example this one which uses a global text field:
  457.     Set Field [ result, External["TrFile-ContentsDialog", "Please select the Excel file """ & gFileName & """:" )]
  458. This will result in a file selection dialog with this prompt text: 'Please select the Excel file "invoices99.xls":'.
  459. OjThe characters of the file the user selected. If the user pressed cancel an error code "$$-1" is returned.
  460. [FileMaker fields are limited to 64000 characters. So files longer than 64000 bytes are cut after the 64000th character.  Use the partial reading of "TrFile-GetContents" to read in longer files.
  461. Aslo note that high ASCII characters are not converted to the internal Filemaker format. Use "TrFile-ConvertToFMText" to convert to the Filemaker format.
  462. Shows the user a file selection dialog, the contents of the selected file is returned.
  463. This function is a combination of "TrFile-Get FileSpec Dialog" followed by a "TrFile-GetContents" function. 
  464. ** prompt:     adds a prompt text to the GetFile Dialog. It may be left empty.
  465. initialFolder:    (optional) the FileSpec or path to the folder where the dialog initially starts.
  466. ** The characters of the file the user selected. If the user pressed cancel an error code "$$-1" is returned.
  467. ** FileMaker fi
  468. elds are limited to 64000 characters. So files longer than 64000 bytes are cut after the 64000th character.  Use the partial reading of "TrFile-GetContents" to read in longer files.
  469. Aslo note that high ASCII characters are not converted to the internal Filemaker format. Use "TrFile-ConvertToFMText" to convert to the Filemaker format.
  470. **     Set Field [ result, External["TrFile-ContentsDialog", "Please select the text file you want to be used:|D:\DataFiles\" )]
  471. You can also use a calculati
  472. 5on for the prompt, for example this one which uses a global text field:
  473.     Set Field [ result, External["TrFile-ContentsDialog", "Please select the Excel file """ & gFileName & """:" )]
  474. This will result in a file selection dialog with this prompt text: 'Please select the Excel file "invoices99.xls":'.
  475. 4/3/2000
  476. 4:13:56 PM
  477. TrFile-CreateFilef
  478. FileSpecj
  479. Filesu
  480. Troi File Plug-in
  481. D0001
  482. J?Set Field [ result, External("TrFile-CreateFile", "FileSpec" )]
  483. KqCreates a new empty file in the location indicated by the FileSpec. This function requires no user intervention.
  484. M6FileSpec:     the Filespec or path to the file to create.
  485. Set Field[gErrorCode, External("TrFile-CreateFile", "C:\Testtext.txt" )]
  486. This will create the empty file "Testtext.txt" on the C disk.
  487. EXAMPLE 2
  488. We assume that in your FileMaker file the following fields are defined:
  489.   gErrorCode        Global, number
  490.   gDestFilePath        Global, text
  491. gDestFilePath should contain the path to the destination and should not exist, for example "D:\Logs\L2000_01.TXT" (Windows) or "Mac HD:Logs:Log 2000_01" (Mac). In ScriptMaker add the following scriptstep:
  492.     SetB| Field[gErrorCode, External("TrFile-CreateFile", gDestFilePath )]
  493. This will create the file indicated in the gDestFilePath.
  494. file the following fields are defined:
  495.   gErrorCode        Global, number
  496.   gSourceFilePath    Global, text
  497.   gDestFilePath        Global, text
  498. gSourceFilePath should contain the path to an existing file, for example "D:\Logs\Log01.TXT" (Windows) or "Mac HD:Logs:Log 1" (Mac).  gDestFilePath should contain the path to the destination and should not exist, for example "D:\Logs\L2000_01.TXT" (Windows) or "Mac HD:Logs:Log 2000_01" (Mac). In ScriptMaker add the following scriptstep:
  499.     Set Field[gErrorCodC
  500. e, External("TrFile-CopyFile", gSourceFilePath & "|" & gDestFilePath )]
  501. This will copy the source file to the path indicated in the gDestFilePath.
  502. The returned result is an error code. An error always starts with 2 dollars, followed by the error code. You should always check for errors. Returned error codes can be:
  503.     0    no error      The file was copied
  504.     $$-43     fnfErr          Source file not found, or destination directory does not exist
  505.     $$-48      dupFNErr      Destination file already exists
  506.     $$-1      genericErr      The file could not be copied
  507. Other errors may be returned. 
  508. Use the TrFile-DeleteFile to delete a file first if it exists. See also the function "TrFile-Save FileSpec Dialog" to get a FileSpec for a file.
  509. Copies a file to the specified path.
  510. ** source FileSpec:     the Filespec or path to the file to copy.
  511. destination FileSpec:     the Filespec or path where the file must be copied to.
  512. ** The returned result is an error code. An error always starts with 2 dollars, followed by the error code. You should always check for errors. Returned error codes can be:
  513.     0    no error      The file was copied
  514.     $$-43     fnfErr          Source file not found, or destination directory does not exist
  515.     $$-48      dupFNErr      Destinat
  516. ion file already exists
  517.     $$-1      genericErr      The file could not be copied
  518. Other errors may be returned. 
  519. ** Use the TrFile-DeleteFile to delete a file first if it exists. See also the function "TrFile-Save FileSpec Dialog" to get a FileSpec for a file.
  520. ** Assume your C disk already contains a file "Testtext.txt". We assume that a global number field gErrorCode is defined. In ScriptMaker create the following script:
  521.     Set Field[gErrorCode, External("TrFile-CopyFile", "C:\Testtext.txt|D:\
  522. MyFiles\TestDupl.txt" )]
  523. This script will copy the file "Testtext.txt"  to  the "TestDupl.txt" file in directory "MyFiles" on the D: disk. On Mac OS the paths will be of the form "Mac HD:MyFiles:TestDupl.txt".
  524. EXAMPLE 2
  525. We assume that in your FileMaker file the following fields are defined:
  526.   gErrorCode        Global, number
  527.   gSourceFilePath    Global, text
  528.   gDestFilePath        Global, text
  529. gSourceFilePath should contain the path to an existing file, for example "D:\Logs\Log01.TXT" (Windows) or "
  530. Mac HD:Logs:Log 1" (Mac).  gDestFilePath should contain the path to the destination and should not exist, for example "D:\Logs\L2000_01.TXT" (Windows) or "Mac HD:Logs:Log 2000_01" (Mac). In ScriptMaker add the following scriptstep:
  531.     Set Field[gErrorCode, External("TrFile-CopyFile", gSourceFilePath & "|" & gDestFilePath )]
  532. This will copy the source file to the path indicated in the gDestFilePath.
  533. 4/3/2000
  534. 4:13:56 PM
  535. TrFile-CreateFolderf
  536. FileSpecj
  537. Filesu
  538. Troi File Plug-in
  539. D0001
  540. JASet Field [ result, External("TrFile-CreateFolder", "FileSpec" )]
  541. K-Creates a new (empty) folder (subdirectory).
  542. M,FileSpec : the path to the folder to create.
  543. We assume that a global number field gErrorCode is defined. In ScriptMaker create the following script:
  544.     Set Field[gErrorCode, External("TrFile-CreateFolder", "C:\Data\NewFolder\" )]
  545. This script will create the folder "NewFolder"  inside the Data folder on the C disk. 
  546. On Mac OS this will be:
  547.    Set Field[gErrorCode, External("TrFile-CreateFolder", "MyDisk:Data:NewFolder:" )]
  548. EXAMPLE 2
  549. We assume that in your FileMaker file the following fields are defined:
  550.   gErrorCode        Global, nu
  551. OThe returned result is an error code. An error always starts with 2 dollars, followed by the error code. You should always check for errors. Returned error codes can be:
  552.     0    no error      The file was created
  553.     $$-48      dupFNErr      Destination file already exists
  554.     $$-1      genericErr      The file could not created
  555. Other errors may be returned.
  556. RSSee also the function "TrFile-Save FileSpec Dialog" to get a FileSpec for the file.
  557. Creates a new empty file in the location indicated by the FileSpec. This function requires no user intervention.
  558. ** FileSpec:     the Filespec or path to the file to create.
  559. ** The returned result is an error code. An error always starts with 2 dollars, followed by the error code. You should always check for errors. Returned error codes can be:
  560.     0    no error      The file was created
  561.     $$-48      dupFNErr      Destination file already exists
  562.     $$-1      genericErr      The file could not created
  563. Other errors 
  564. may be returned.
  565. ** See also the function "TrFile-Save FileSpec Dialog" to get a FileSpec for the file.
  566. ** Set Field[gErrorCode, External("TrFile-CreateFile", "C:\Testtext.txt" )]
  567. This will create the empty file "Testtext.txt" on the C disk.
  568. EXAMPLE 2
  569. We assume that in your FileMaker file the following fields are defined:
  570.   gErrorCode        Global, number
  571.   gDestFilePath        Global, text
  572. gDestFilePath should contain the path to the destination and should not exist, for example "D:\Logs\L2000_C
  573. 01.TXT" (Windows) or "Mac HD:Logs:Log 2000_01" (Mac). In ScriptMaker add the following scriptstep:
  574.     Set Field[gErrorCode, External("TrFile-CreateFile", gDestFilePath )]
  575. This will create the file indicated in the gDestFilePath.
  576. 4/3/2000
  577. 4:13:56 PM
  578. TrFile-DeleteFilef
  579. FileSpecj
  580. Filesu
  581. Troi File Plug-in
  582. D0001
  583. J?Set Field [ result, External("TrFile-DeleteFile", "FileSpec" )]
  584. KXDeletes the file indicated by the FileSpec. This function requires no user intervention.
  585. M6FileSpec:     the Filespec or path to the file to delete.
  586. Assume your C disk already contains a file "TestFile.xls". We assume that a global number field gErrorCode is defined. In ScriptMaker create the following script:
  587.     Set Field[gErrorCode, External("TrFile-DeleteFile", "C:\TestFile.xls" )]
  588. This script will delete the file "TestFile.xls". On Mac OS the path will be of the form "Mac HD:TestFile.xls".
  589. EXAMPLE 2
  590. We assume that in your FileMaker file the following fields are defined:
  591.   gErrorCode        Global, number
  592.   gFilePath        Global, text
  593. rmber
  594.   gFolderPath        Global, text
  595. gFolderPath should contain the path to the folder to be created and should not exist, for example "D:\Logs\Data\" (Windows) or "Mac HD:Logs:Data:" (Mac OS). In ScriptMaker add the following scriptstep:
  596.     Set Field[gErrorCode, External("TrFile-CreateFolder", gFolderPath )]
  597. This will create the folder specified in the gFolderPath.
  598. XThe returned result is an error code. An error always starts with 2 dollars, followed by the error code. You should always check for errors. Returned error codes can be:
  599.     0    no error      The folder was created
  600.     $$-48      dupFNErr      Destination folder already exists
  601.     $$-1      genericErr      The folder could not be created
  602. Other errors may be returned.
  603. See also the functions: "TrFile-Save FileSpec Dialog" to get a FileSpec for a folder, 
  604. "TrFile-CreateFile" to create a new empty file.
  605. Creates a new (empty) folder (subdirectory).
  606. ** FileSpec : the path to the folder to create.
  607. ** The returned result is an error code. An error always starts with 2 dollars, followed by the error code. You should always check for errors. Returned error codes can be:
  608.     0    no error      The folder was created
  609.     $$-48      dupFNErr      Destination folder already exists
  610.     $$-1      genericErr      The folder could not be created
  611. Other errors may be returned.
  612. ** See also the functions: "TrFile-Save FileSpec Dia
  613. log" to get a FileSpec for a folder, 
  614. "TrFile-CreateFile" to create a new empty file.
  615. ** We assume that a global number field gErrorCode is defined. In ScriptMaker create the following script:
  616.     Set Field[gErrorCode, External("TrFile-CreateFolder", "C:\Data\NewFolder\" )]
  617. This script will create the folder "NewFolder"  inside the Data folder on the C disk. 
  618. On Mac OS this will be:
  619.    Set Field[gErrorCode, External("TrFile-CreateFolder", "MyDisk:Data:NewFolder:" )]
  620. EXAMPLE 2
  621. We assu
  622. me that in your FileMaker file the following fields are defined:
  623.   gErrorCode        Global, number
  624.   gFolderPath        Global, text
  625. gFolderPath should contain the path to the folder to be created and should not exist, for example "D:\Logs\Data\" (Windows) or "Mac HD:Logs:Data:" (Mac OS). In ScriptMaker add the following scriptstep:
  626.     Set Field[gErrorCode, External("TrFile-CreateFolder", gFolderPath )]
  627. This will create the folder specified in the gFolderPath.
  628. 4/3/2000
  629. 4:13:56 PM
  630. TrFile-FileSpec To FullPathf
  631. FileSpecj
  632. Filesu
  633. Troi File Plug-in
  634. D0001
  635. JISet Field [ result, External("TrFile-FileSpec To FullPath", "FileSpec" )]
  636. KCReturns full path of a file or folder from the FSSpec. Mac OS only.
  637. M^FileSpec:     the FSSpec of a file or folder. It is of the form ":volumeID:directoryID:fileName"
  638. Set Field[result, External("TrFile-FileSpec To FullPath", ":-1:300:testfile" )]
  639. If the FSSpec is valid this may return something like this: 
  640.     "Mac HD:Data Files:Database:testfile"
  641. EXAMPLE 2
  642. We assume that in your FileMaker file the following field is defined:
  643.    gFilePath        Global, text
  644. gFilePath should contain the path to an existing file, for example ":-1:300:testfile". In ScriptMaker add the following scriptstep:
  645.     Set Field[gFilePath, External("TrFile-FileSpec To FullPath", gFiBDlePath )]
  646. This will convert the FSSpec in gFilePath to a Full Path.
  647. 4gFilePath should contain the path to an existing file which you want to delete, for example "D:\Logs\Log01.TXT" (Windows) or "Mac HD:Logs:Log 1" (Mac). In ScriptMaker add the following scriptstep:
  648.     Set Field[gErrorCode, External("TrFile-DeleteFile", gFilePath )]
  649. This will delete the file from the disk.
  650. HThe returned result is an error code. An error always starts with 2 dollars, followed by the error code. You should always check for errors. Returned error codes can be:
  651.     0    no error      The file was deleted
  652.     $$-43     fnfErr          The file was not found
  653.     $$-1      genericErr      The file could not be deleted
  654. Other errors may be returned. 
  655. WARNING: The file is not moved to the Trash, but deleted completely. This can not be undone!
  656. See also 
  657. TrDl-DoDialog
  658.  or use the 
  659. Show Message
  660.  script step if you want to warn the user.
  661. Deletes the file indicated by the FileSpec. This function requires no user intervention.
  662. ** FileSpec:     the Filespec or path to the file to delete.
  663. ** The returned result is an error code. An error always starts with 2 dollars, followed by the error code. You should always check for errors. Returned error codes can be:
  664.     0    no error      The file was deleted
  665.     $$-43     fnfErr          The file was not found
  666.     $$-1      genericErr      The file could not be deleted
  667. Other errors may be returned. 
  668. ** WARNING: The
  669.  file is not moved to the Trash, but deleted completely. This can not be undone!
  670. See also 
  671. TrDl-DoDialog
  672.  or use the 
  673. Show Message
  674.  script step if you want to warn the user.
  675. ** Assume your C disk already contains a file "TestFile.xls". We assume that a global number field gErrorCode is defined. In ScriptMaker create the following script:
  676.     Set Field[gErrorCode, External("TrFile-DeleteFile", "C:\TestFile.xls" )]
  677. This script will delete the file "TestFile.xls". On Mac OS the path will be
  678.  of the form "Mac HD:TestFile.xls".
  679. EXAMPLE 2
  680. We assume that in your FileMaker file the following fields are defined:
  681.   gErrorCode        Global, number
  682.   gFilePath        Global, text
  683. gFilePath should contain the path to an existing file which you want to delete, for example "D:\Logs\Log01.TXT" (Windows) or "Mac HD:Logs:Log 1" (Mac). In ScriptMaker add the following scriptstep:
  684.     Set Field[gErrorCode, External("TrFile-DeleteFile", gFilePath )]
  685. This will delete the file from the disk.
  686. 4/3/2000
  687. 4:13:56 PM
  688. OhReturns a full path formatted like this: 
  689.     "DiskName:foldername1:foldername2:...:foldernameN:filename"
  690. On the Mac a disk name need not be unique, be careful with that.
  691. See also the function 
  692. TrFile-FullPath To FileSpec
  693.  to revert the path name.
  694. Returns full path of a file or folder from the FSSpec. Mac OS only.
  695. ** FileSpec:     the FSSpec of a file or folder. It is of the form ":volumeID:directoryID:fileName"
  696. ** Returns a full path formatted like this: 
  697.     "DiskName:foldername1:foldername2:...:foldernameN:filename"
  698. On the Mac a disk name need not be unique, be careful with that.
  699. See also the function 
  700. TrFile-FullPath To FileSpec
  701.  to revert the path name.
  702. ** Set Field[result, External("TrFile-FileSpec To FullPath", ":-1:300:
  703. testfile" )]
  704. If the FSSpec is valid this may return something like this: 
  705.     "Mac HD:Data Files:Database:testfile"
  706. EXAMPLE 2
  707. We assume that in your FileMaker file the following field is defined:
  708.    gFilePath        Global, text
  709. gFilePath should contain the path to an existing file, for example ":-1:300:testfile". In ScriptMaker add the following scriptstep:
  710.     Set Field[gFilePath, External("TrFile-FileSpec To FullPath", gFilePath )]
  711. This will convert the FSSpec in gFilePath to a Full PathC
  712. 4/3/2000
  713. 4:13:56 PM
  714. TrFile-FindFolderf
  715. folderconstantj
  716. Filesu
  717. Troi File Plug-in
  718. D0001
  719. JESet Field [ result, External("TrFile-FindFolder", "folderconstant" )]
  720. K>Finds special folders (subdirectories). Currently Mac OS only.
  721. folderconstant: Specifies which folder to return, must be one of the following:
  722. desktop       = desktop folder
  723. system       = system folder
  724. trash          = trash folder on the desktop
  725. shutdown    = shutdown items folder in the system folder
  726. applemenu    = apple menu folder in the system folder
  727. controlpanels    = control panels folder in the system folder
  728. extensions    = extensions folder in the system folder
  729. preferences      = preferences folder in the system folder
  730. temporary    = hidden temporary folder on the stB2artup disk
  731. root         = top folder on the startup disk
  732. LSet Field [ result, External["TrFile-FindFolder", "trash" )]
  733. This will return the FSSpec of the Trash folder. 
  734. TIP: With this folder and the MoveFile function you can move items into the Trash.
  735. EXAMPLE 2
  736. Set Field [ gStartupDiskFolder, External["TrFile-FindFolder", "root" )]
  737. This will return the top folder on the startup disk.
  738. O&FileSpec:     The Filespec of the folder.
  739. R/Currently Mac OS only. Returns $$-1 on Windows.
  740. Finds special folders (subdirectories). Currently Mac OS only.
  741. ** folderconstant: Specifies which folder to return, must be one of the following:
  742. desktop       = desktop folder
  743. system       = system folder
  744. trash          = trash folder on the desktop
  745. shutdown    = shutdown items folder in the system folder
  746. applemenu    = apple menu folder in the system folder
  747. controlpanels    = control panels folder in the system folder
  748. extensions    = extensions folder in the system folder
  749. preferences      = preferences folder 
  750. in the system folder
  751. temporary    = hidden temporary folder on the startup disk
  752. root         = top folder on the startup disk
  753. ** FileSpec:     The Filespec of the folder.
  754. ** Currently Mac OS only. Returns $$-1 on Windows.
  755. ** Set Field [ result, External["TrFile-FindFolder", "trash" )]
  756. This will return the FSSpec of the Trash folder. 
  757. TIP: With this folder and the MoveFile function you can move items into the Trash.
  758. EXAMPLE 2
  759. Set Field [ gStartupDiskFolder, External["TrFile-FindFolder", "root" )]
  760. TC7his will return the top folder on the startup disk.
  761. 4/3/2000
  762. 4:13:56 PM
  763. TrFile-FolderListf
  764. switches | FileSpecj
  765. Filesu
  766. Troi File Plug-in
  767. D0001
  768. JJSet Field [ result, External("TrFile-FolderList", "switches | FileSpec" )]
  769. KuLists what is inside a folder (directory). It will return all files and/or folders, depending on the switches given.
  770. switches:     these determine the items that are listed.
  771. FileSpec:     the FileSpec or path to the folder to list.
  772. switches can be one or more of the following:
  773. files        list all files in this folder
  774. folders        list all folders (subdirectories) in this folder
  775. showaliases    list all aliases (shortcuts) in this folder
  776. showshortcuts    list all aliases (shortcuts) in this folder (you can use the one you like)
  777. showinvisibles    list all invisible files and folders
  778. showpointdirs    Windows: list also the directoryBR . (current dir) and .. (parent dir)
  779. showpointdirs    Mac OS: this switch is ignored
  780. Set Field [ result, External("TrFile-ListFolder";  "files & folders |Mac HD:") ]
  781. This will return a list of all files and folders on the hard disk "Mac HD". Note that the order of the switches is not relevant, and also the & is just there for readability. This might be returned:
  782.     Test.fp3
  783.     Desktop Folder
  784.     Program files
  785.     etc...
  786. On Windows an example usage is:
  787.     Set Field [ result, External("TrFile-ListFolder";  "files & showshortcuts|C:\Data\") ]
  788. This will return a list of all files
  789.  and shortcuts on the hard disk "C:\Data\".
  790. EXAMPLE 2
  791. We assume that in your FileMaker file the following fields are defined:
  792.   gFolderPath        Global, text
  793.   gFolderList        Global, text
  794. gFolderPath should contain the path to the folder, for example "D:\Logs\Data\" (Windows) or "Mac HD:Logs:Data:" (Mac OS). In ScriptMaker add the following scriptstep:
  795.     Set Field[gFolderList, External("TrFile-FolderList", "files & folders |" & gFolderPath )]
  796. This will list the contents of the folder sp
  797. ecified in the gFolderPath.
  798. O@folder list    a list of names of the items separated by returns. 
  799. RANote that each item, including the last, is followed by a return.
  800. Lists what is inside a folder (directory). It will return all files and/or folders, depending on the switches given.
  801. ** switches:     these determine the items that are listed.
  802. FileSpec:     the FileSpec or path to the folder to list.
  803. switches can be one or more of the following:
  804. files        list all files in this folder
  805. folders        list all folders (subdirectories) in this folder
  806. showaliases    list all aliases (shortcuts) in this folder
  807. showshortcuts    list all aliases (shortcuts) in this folder (you can
  808.  use the one you like)
  809. showinvisibles    list all invisible files and folders
  810. showpointdirs    Windows: list also the directory . (current dir) and .. (parent dir)
  811. showpointdirs    Mac OS: this switch is ignored
  812. ** folder list    a list of names of the items separated by returns. 
  813. ** Note that each item, including the last, is followed by a return.
  814. ** Set Field [ result, External("TrFile-ListFolder";  "files & folders |Mac HD:") ]
  815. This will return a list of all files and folders on the hard disk "M
  816. ac HD". Note that the order of the switches is not relevant, and also the & is just there for readability. This might be returned:
  817.     Test.fp3
  818.     Desktop Folder
  819.     Program files
  820.     etc...
  821. On Windows an example usage is:
  822.     Set Field [ result, External("TrFile-ListFolder";  "files & showshortcuts|C:\Data\") ]
  823. This will return a list of all files and shortcuts on the hard disk "C:\Data\".
  824. EXAMPLE 2
  825. We assume that in your FileMaker file the following fields are defined:
  826.   gFolderPath        Global,
  827. w text
  828.   gFolderList        Global, text
  829. gFolderPath should contain the path to the folder, for example "D:\Logs\Data\" (Windows) or "Mac HD:Logs:Data:" (Mac OS). In ScriptMaker add the following scriptstep:
  830.     Set Field[gFolderList, External("TrFile-FolderList", "files & folders |" & gFolderPath )]
  831. This will list the contents of the folder specified in the gFolderPath.
  832. 4/3/2000
  833. 4:13:56 PM
  834. TrFile-FullPath To FileSpecf
  835. FileSpecj
  836. Filesu
  837. Troi File Plug-in
  838. D0001
  839. JISet Field [ result, External("TrFile-FullPath To FileSpec", "FileSpec" )]
  840. K=Changes the full name path to the standard Macintosh FSSpec.
  841. M~FileSpec:     the Full path of a file or folder. It is of the form 
  842.         "DiskName:foldername1:foldername2:...:foldernameN:filename"
  843. Set Field[result, External("TrFile-FullPath To FileSpec", "Mac HD:Data Files:Database:testfile" )]
  844. If the path is valid this may return something like this: 
  845.     ":-1:300:testfile"
  846. EXAMPLE 2
  847. We assume that in your FileMaker file the following field is defined:
  848.    gFilePath        Global, text
  849. gFilePath should contain the path to an existing file, for example "Mac HD:Data Files:Database:testfile". In ScriptMaker add the following scriptstep:
  850.     Set Field[gFilePath, External("TrFile-FullPath TBUo FileSpec", gFilePath )]
  851. This will convert the Full Path in gFilePath to an FSSpec.
  852. Returns a Mac OS FSSpec formatted like this: 
  853.     ":volumeID:directoryID:fileName"
  854. This is the preferred way on the Mac to specify a file.
  855. An FSSpec is recognized by the colon as the first character. 
  856. On the Mac a disk name need not be unique, be careful with that.
  857. Changes the full name path to the standard Macintosh FSSpec.
  858. ** FileSpec:     the Full path of a file or folder. It is of the form 
  859.         "DiskName:foldername1:foldername2:...:foldernameN:filename"
  860. ** Returns a Mac OS FSSpec formatted like this: 
  861.     ":volumeID:directoryID:fileName"
  862. This is the preferred way on the Mac to specify a file.
  863. ** An FSSpec is recognized by the colon as the first character. 
  864. On the Mac a disk name need not be unique, be careful with that.
  865. ** Set Field[result, Extern
  866. al("TrFile-FullPath To FileSpec", "Mac HD:Data Files:Database:testfile" )]
  867. If the path is valid this may return something like this: 
  868.     ":-1:300:testfile"
  869. EXAMPLE 2
  870. We assume that in your FileMaker file the following field is defined:
  871.    gFilePath        Global, text
  872. gFilePath should contain the path to an existing file, for example "Mac HD:Data Files:Database:testfile". In ScriptMaker add the following scriptstep:
  873.     Set Field[gFilePath, External("TrFile-FullPath To FileSpec", gFilePath )
  874. This will convert the Full Path in gFilePath to an FSSpec.
  875. 4/3/2000
  876. 4:13:56 PM
  877. TrFile-Get FileSpec Dialogf
  878. promptj
  879. Filesu
  880. Troi File Plug-in
  881. D0001
  882. JVSet Field [ result, External("TrFile-Get FileSpec Dialog", "prompt | initialFolder" )]
  883. KOPresents the user with a standard dialog and displays all files in a directory.
  884. prompt:      the prompt that will be displayed to tell the user which file to select.
  885. initialFolder:    (optional) the FileSpec or path to the folder where the dialog initially starts.
  886. On MacOS: 
  887. Set Field[MyFileName, External("TrFile-Get FileSpec Dialog", "Please choose a file to import|Mac HD:Solution Files:Import:")] 
  888. Or on Windows:
  889. Set Field[MyFileName, External("TrFile-Get FileSpec Dialog", "Please choose a file to import|C:\Solution Files\Import\")] 
  890. This will start the selection at the folder "Import" in the "Solution Files" Folder. It returns "HD Mac:Text files:My Letter" if the user selects that particular file on MacOS. On Windows it may return "C:\Text filesB
  891. \My Letter".
  892. FileSpec:     The function returns a FileSpec for the selected file to be used with one of the file
  893.         manipulation functions.
  894. If the user cancels an error code of "$$-1" is returned.
  895. Presents the user with a standard dialog and displays all files in a directory.
  896. ** prompt:      the prompt that will be displayed to tell the user which file to select.
  897. initialFolder:    (optional) the FileSpec or path to the folder where the dialog initially starts.
  898. ** FileSpec:     The function returns a FileSpec for the selected file to be used with one of the file
  899.         manipulation functions.
  900. If the user cancels an error code of "$$-1" is returned.
  901. ** On MacOS: 
  902. Set Field[MyFileName, Externa
  903. l("TrFile-Get FileSpec Dialog", "Please choose a file to import|Mac HD:Solution Files:Import:")] 
  904. Or on Windows:
  905. Set Field[MyFileName, External("TrFile-Get FileSpec Dialog", "Please choose a file to import|C:\Solution Files\Import\")] 
  906. This will start the selection at the folder "Import" in the "Solution Files" Folder. It returns "HD Mac:Text files:My Letter" if the user selects that particular file on MacOS. On Windows it may return "C:\Text files\My Letter".
  907. 4/3/2000
  908. 4:13:56 PM
  909. TrFile-GetContentsf
  910. promptj
  911. Filesu
  912. Troi File Plug-in
  913. D0001
  914. JOSet Field [ result, External("TrFile-GetContents", "fileSpec| start | size"  )]
  915. Returns (a part of) the contents of the file specified by the FileSpec. When a start is given this function extracts characters from the specified file, starting at the position specified by start and containing the number of characters specified by size.
  916. fileSpec:     the Filespec or path to the file.
  917. start:         (optional) starting position in the file.
  918. size:         (optional) the number of characters to get.
  919. Set Field[MyTextField, External("TrFile-GetContents", "HD Mac:Text files:My Letter")] 
  920. returns the contents of the file.
  921. EXAMPLE 2
  922. We assume that in your FileMaker file the following fields are defined:
  923.     gContents        Global, text                gStart      Global, number
  924.     gFileSpec        Global, text                 gLength    Global, number
  925. gFileSpec should contain the path to an existing file, for example "D:\Readme.txt" (Windows) or "Mac HD:Readme.txt" (Mac). In gStart should be the start pos
  926. ition and in gLength the number of bytes you want to get. In ScriptMaker add the following scriptstep:
  927.     Set Field[gContents, External("TrFile-GetContents", gFileSpec & "|" & gStart & "|" & gLength)]
  928. This will get part of the contents of the file into the gContents field.
  929. OcThe characters of the file specified. If the user pressed cancel an error code "$$-1" is returned.
  930. JFileMaker fields are limited to 64000 characters. So results longer than 64000 bytes are cut after the 64000th character.  Use start and size parameter to read in longer files.
  931. Also note that High ASCII characters are not converted to the internal Filemaker format. Use "TrFile-ConvertToFMText" to convert to the Filemaker format.
  932. Returns (a part of) the contents of the file specified by the FileSpec. When a start is given this function extracts characters from the specified file, starting at the position specified by start and containing the number of characters specified by size.
  933. ** fileSpec:     the Filespec or path to the file.
  934. start:         (optional) starting position in the file.
  935. size:         (optional) the number of characters to get.
  936. ** The characters of the file specified. If the user pressed cancel an error code "$$-1
  937. " is returned.
  938. ** FileMaker fields are limited to 64000 characters. So results longer than 64000 bytes are cut after the 64000th character.  Use start and size parameter to read in longer files.
  939. Also note that High ASCII characters are not converted to the internal Filemaker format. Use "TrFile-ConvertToFMText" to convert to the Filemaker format.
  940. ** Set Field[MyTextField, External("TrFile-GetContents", "HD Mac:Text files:My Letter")] 
  941. returns the contents of the file.
  942. EXAMPLE 2
  943. We assum
  944. e that in your FileMaker file the following fields are defined:
  945.     gContents        Global, text                gStart      Global, number
  946.     gFileSpec        Global, text                 gLength    Global, number
  947. gFileSpec should contain the path to an existing file, for example "D:\Readme.txt" (Windows) or "Mac HD:Readme.txt" (Mac). In gStart should be the start position and in gLength the number of bytes you want to get. In ScriptMaker add the following scriptstep:
  948.     Set Field[gContents, External("Tr
  949. File-GetContents", gFileSpec & "|" & gStart & "|" & gLength)]
  950. This will get part of the contents of the file into the gContents field.
  951. 4/3/2000
  952. 4:13:56 PM
  953. TrFile-GetDataSizef
  954. FileSpecj
  955. Filesu
  956. Troi File Plug-in
  957. D0001
  958. J@Set Field [ result, External("TrFile-GetDataSize", "FileSpec" )]
  959. Returns the size of the data for the file specified by the FileSpec. The size indicates the actual number of bytes used by the data fork.
  960. M,FileSpec:     the Filespec or path to the file.
  961. Assume there is a file "Read me" with the text "Hello!" in it. Then:
  962.       Set Field[MyTextField, External("TrFile-GetDataSize", "Disk:Read me")] 
  963. returns 6, which is the size of the data in the file. The total file size may be bigger.
  964. EXAMPLE 2
  965. We assume that in your FileMaker file the following fields are defined:
  966.     gFileSpec        Global, text
  967.     gSize           Global, number
  968. gFileSpec should contain the path to an existing file, for example "D:\Readme.txt" (Windows) or "Mac HD:Readme.B
  969. txt" (Mac). In ScriptMaker add the following scriptstep:
  970.       Set Field[gSize, External("TrFile-GetDataSize", gFileSpec)]
  971. This will fill gSize with the size of the data.
  972. The size (in bytes) of the data of the file specified.  On Mac a file can have a data fork and also a resource fork. On Mac OS this function returns the size of the data fork only.
  973. RHSee also the functions "TrFile-GetFileSize" and "TrFile-GetResForkSize".
  974. Returns the size of the data for the file specified by the FileSpec. The size indicates the actual number of bytes used by the data fork.
  975. ** FileSpec:     the Filespec or path to the file.
  976. ** The size (in bytes) of the data of the file specified.  On Mac a file can have a data fork and also a resource fork. On Mac OS this function returns the size of the data fork only.
  977. ** See also the functions "TrFile-GetFileSize" and "TrFile-GetResForkSize".
  978. ** Assume there is a file "Read me" with the t
  979. ext "Hello!" in it. Then:
  980.       Set Field[MyTextField, External("TrFile-GetDataSize", "Disk:Read me")] 
  981. returns 6, which is the size of the data in the file. The total file size may be bigger.
  982. EXAMPLE 2
  983. We assume that in your FileMaker file the following fields are defined:
  984.     gFileSpec        Global, text
  985.     gSize           Global, number
  986. gFileSpec should contain the path to an existing file, for example "D:\Readme.txt" (Windows) or "Mac HD:Readme.txt" (Mac). In ScriptMaker add the followin
  987. g scriptstep:
  988.       Set Field[gSize, External("TrFile-GetDataSize", gFileSpec)]
  989. This will fill gSize with the size of the data.
  990. 4/3/2000
  991. 4:13:56 PM
  992. TrFile-GetDateCreatedf
  993. FileSpecj
  994. Filesu
  995. Troi File Plug-in
  996. D0001
  997. JCSet Field [ result, External("TrFile-GetDateCreated", "FileSpec" )]
  998. KAReturns the creation date for the file specified by the FileSpec.
  999. MNFileSpec:    the Filespec or path to the file for which you want the information.
  1000. Set Field[creationDate, External("TrFile-GetDateCreated", "C:\Test.txt" )]
  1001. This may return the number 730172 which is equivalent to the date: 22 Feb. 2000.
  1002. EXAMPLE 2
  1003. We assume that in your FileMaker file the following fields are defined:
  1004.   creationDate        date
  1005.   gFilePath        Global, text
  1006. gFilePath should contain the path to the file, for example "D:\Logs\L2000_01.TXT" (Windows) or "Mac HD:Logs:Log 2000_01" (Mac). In ScriptMaker add the following script step:
  1007.     Set Field[creationDate, E
  1008. xternal("TrFile-GetDateCreated", gFilePath )]
  1009. This will store the creation date of the file specified by gFilePath in the field creationDate.
  1010. The returned result is the creation date of the file. The date is in the same format as a date field. 
  1011. An error code might also be returned. An error always starts with 2 dollars, followed by the error code. Returned error codes can be:
  1012.     $$-43     fnfErr          File not found, check if the path is valid
  1013.     $$-1      genericErr      The file could not be found (older versions of the plug-in)
  1014. Other errors may be returned.
  1015. DESCRIPTION
  1016. Returns the creation date for the file specified by the FileSpec.
  1017. ** FileSpec:    the Filespec or path to the file for which you want the information.
  1018. ** The returned result is the creation date of the file. The date is in the same format as a date field. 
  1019. An error code might also be returned. An error always starts with 2 dollars, followed by the error code. Returned error codes can be:
  1020.     $$-43     fnfErr          File not found, check if the path is valid
  1021.     $$-1      genericErr      The file could not be f
  1022. ound (older versions of the plug-in)
  1023. Other errors may be returned.
  1024. ** Set Field[creationDate, External("TrFile-GetDateCreated", "C:\Test.txt" )]
  1025. This may return the number 730172 which is equivalent to the date: 22 Feb. 2000.
  1026. EXAMPLE 2
  1027. We assume that in your FileMaker file the following fields are defined:
  1028.   creationDate        date
  1029.   gFilePath        Global, text
  1030. gFilePath should contain the path to the file, for example "D:\Logs\L2000_01.TXT" (Windows) or "Mac HD:Logs:Log 2000_01" (Mac). I
  1031. n ScriptMaker add the following script step:
  1032.     Set Field[creationDate, External("TrFile-GetDateCreated", gFilePath )]
  1033. This will store the creation date of the file specified by gFilePath in the field creationDate.
  1034. 4/3/2000
  1035. 4:13:56 PM
  1036. TrFile-GetDateModifiedf
  1037. FileSpecj
  1038. Filesu
  1039. Troi File Plug-in
  1040. D0001
  1041. JDSet Field [ result, External("TrFile-GetDateModified", "FileSpec" )]
  1042. Returns the modification date for the file specified by the FileSpec. The modification date is also displayed in the Finder or Explorer.
  1043. MNFileSpec:    the Filespec or path to the file for which you want the information.
  1044. Set Field[modificationDate, External("TrFile-GetDateModified", "C:\Test.txt" )]
  1045. This may return the number 730173 which is equivalent to the date: 23 Feb. 2000.
  1046. EXAMPLE 2
  1047. We assume that in your FileMaker file the following fields are defined:
  1048.   modificationDate    date
  1049.   gFilePath        Global, text
  1050. gFilePath should contain the path to the file, for example "D:\Logs\L2000_01.TXT" (Windows) or "Mac HD:Logs:Log 2000_01" (Mac). In ScriptMaker add the following script step:
  1051.     Set Field[modificB
  1052. ationDate, External("TrFile-GetDateModified", gFilePath )]
  1053. This will store the modification date of the file specified by gFilePath in the field modificationDate.
  1054. The returned result is the modification date of the file. The date is in the same format as a date field. 
  1055. An error code might also be returned. An error always starts with 2 dollars, followed by the error code. Returned error codes can be:
  1056.     $$-43     fnfErr          File not found, check if the path is valid
  1057.     $$-1      genericErr      The file could not be found (older versions of the plug-in)
  1058. Other errors may be returned.
  1059. Returns the modification date for the file specified by the FileSpec. The modification date is also displayed in the Finder or Explorer.
  1060. ** FileSpec:    the Filespec or path to the file for which you want the information.
  1061. ** The returned result is the modification date of the file. The date is in the same format as a date field. 
  1062. An error code might also be returned. An error always starts with 2 dollars, followed by the error code. Returned error codes can be:
  1063.     $$-43     fnfErr          File not fo
  1064. und, check if the path is valid
  1065.     $$-1      genericErr      The file could not be found (older versions of the plug-in)
  1066. Other errors may be returned.
  1067. ** Set Field[modificationDate, External("TrFile-GetDateModified", "C:\Test.txt" )]
  1068. This may return the number 730173 which is equivalent to the date: 23 Feb. 2000.
  1069. EXAMPLE 2
  1070. We assume that in your FileMaker file the following fields are defined:
  1071.   modificationDate    date
  1072.   gFilePath        Global, text
  1073. gFilePath should contain the path to the file
  1074. >, for example "D:\Logs\L2000_01.TXT" (Windows) or "Mac HD:Logs:Log 2000_01" (Mac). In ScriptMaker add the following script step:
  1075.     Set Field[modificationDate, External("TrFile-GetDateModified", gFilePath )]
  1076. This will store the modification date of the file specified by gFilePath in the field modificationDate.
  1077. 4/3/2000
  1078. 4:13:56 PM
  1079. TrFile-GetDateTimeCreatedf
  1080. FileSpecj
  1081. Filesu
  1082. Troi File Plug-in
  1083. D0001
  1084. JGSet Field [ result, External("TrFile-GetDateTimeCreated", "FileSpec" )]
  1085. KKReturns the creation date and time for the file specified by the FileSpec.
  1086. MNFileSpec:    the Filespec or path to the file for which you want the information.
  1087. Set Field[result, External("TrFile-GetDateTimeModified", "C:\Test.txt" )]
  1088. This may return the result: "2000-02-22 15:55:17". 
  1089. EXAMPLE 2
  1090. We assume that in your FileMaker file the following fields are defined:
  1091.   creationDateTime    text
  1092.   gFilePath        Global, text
  1093. gFilePath should contain the path to the file, for example "D:\Logs\L01.TXT" (Windows) or 
  1094. "Mac HD:Logs:Log File 1" (Mac). In ScriptMaker add the following script step:
  1095.     Set Field[creationDateTime, External("TrFile-GetDateTimeCB
  1096. reated", gFilePath )]
  1097. This will store the creation date and time of the file specified by gFilePath in the field creationDateTime.
  1098. The returned result is the creation date and time of the file. The result is formatted like this:
  1099. YYYY-MM-DD HH:MM:SS. Store the result in a text field.
  1100. An error code might also be returned. An error always starts with 2 dollars, followed by the error code. Returned error codes can be:
  1101.     $$-43     fnfErr          File not found, check if the path is valid
  1102.     $$-1      genericErr      The file could not be found (older versions of the plug-in)
  1103. Other errors may be returned.
  1104. Returns the creation date and time for the file specified by the FileSpec.
  1105. ** FileSpec:    the Filespec or path to the file for which you want the information.
  1106. ** The returned result is the creation date and time of the file. The result is formatted like this:
  1107. YYYY-MM-DD HH:MM:SS. Store the result in a text field.
  1108. An error code might also be returned. An error always starts with 2 dollars, followed by the error code. Returned error codes can be:
  1109.     $$-43     fnfErr          File not found, check if th
  1110. e path is valid
  1111.     $$-1      genericErr      The file could not be found (older versions of the plug-in)
  1112. Other errors may be returned.
  1113. ** Set Field[result, External("TrFile-GetDateTimeModified", "C:\Test.txt" )]
  1114. This may return the result: "2000-02-22 15:55:17". 
  1115. EXAMPLE 2
  1116. We assume that in your FileMaker file the following fields are defined:
  1117.   creationDateTime    text
  1118.   gFilePath        Global, text
  1119. gFilePath should contain the path to the file, for example "D:\Logs\L01.TXT" (Windows) or 
  1120. "Mac 
  1121. HD:Logs:Log File 1" (Mac). In ScriptMaker add the following script step:
  1122.     Set Field[creationDateTime, External("TrFile-GetDateTimeCreated", gFilePath )]
  1123. This will store the creation date and time of the file specified by gFilePath in the field creationDateTime.
  1124. 4/3/2000
  1125. 4:13:56 PM
  1126. TrFile-GetDateTimeModifiedf
  1127. FileSpecj
  1128. Filesu
  1129. Troi File Plug-in
  1130. D0001
  1131. JHSet Field [ result, External("TrFile-GetDateTimeModified", "FileSpec" )]
  1132. Returns the modification date and time for the file specified by the FileSpec. The modification date and time are also displayed in the Finder or Explorer.
  1133. MNFileSpec:    the Filespec or path to the file for which you want the information.
  1134. Set Field[result, External("TrFile-GetDateTimeModified", "C:\Test.txt" )]
  1135. This may return the result: "2000-12-31 15:55:17". 
  1136. EXAMPLE 2
  1137. We assume that in your FileMaker file the following fields are defined:
  1138.   modificationDateTime    text
  1139.   gFilePath        Global, text
  1140. gFilePath should contain the path to the file, for example "D:\Logs\L2000_01.TXT" (Windows) or "Mac HD:Logs:Log 2000_01" (Mac). In ScriptMaker add the following script step:
  1141.     Set Field[modificationDateTime, External("TrFileB
  1142. -GetDateTimeModified", gFilePath )]
  1143. This will store the modification date and time of the file specified by gFilePath in the field modificationDateTime.
  1144. The returned result is the modification date and time of the file. The result is formatted like this:
  1145. YYYY-MM-DD HH:MM:SS. Store the result in a text field.
  1146. An error code might also be returned. An error always starts with 2 dollars, followed by the error code. Returned error codes can be:
  1147.     $$-43     fnfErr          File not found, check if the path is valid
  1148.     $$-1      genericErr      The file could not be found (older versions of the plug-in)
  1149. Other errors may be returned.
  1150. Returns the modification date and time for the file specified by the FileSpec. The modification date and time are also displayed in the Finder or Explorer.
  1151. ** FileSpec:    the Filespec or path to the file for which you want the information.
  1152. ** The returned result is the modification date and time of the file. The result is formatted like this:
  1153. YYYY-MM-DD HH:MM:SS. Store the result in a text field.
  1154. An error code might also be returned. An error always starts with 2 dollars, followed by the e
  1155. rror code. Returned error codes can be:
  1156.     $$-43     fnfErr          File not found, check if the path is valid
  1157.     $$-1      genericErr      The file could not be found (older versions of the plug-in)
  1158. Other errors may be returned.
  1159. ** Set Field[result, External("TrFile-GetDateTimeModified", "C:\Test.txt" )]
  1160. This may return the result: "2000-12-31 15:55:17". 
  1161. EXAMPLE 2
  1162. We assume that in your FileMaker file the following fields are defined:
  1163.   modificationDateTime    text
  1164.   gFilePath        Global, text
  1165. gFilePa
  1166. yth should contain the path to the file, for example "D:\Logs\L2000_01.TXT" (Windows) or "Mac HD:Logs:Log 2000_01" (Mac). In ScriptMaker add the following script step:
  1167.     Set Field[modificationDateTime, External("TrFile-GetDateTimeModified", gFilePath )]
  1168. This will store the modification date and time of the file specified by gFilePath in the field modificationDateTime.
  1169. 4/3/2000
  1170. 4:13:56 PM
  1171. TrFile-GetFileCreatorf
  1172. FileSpecj
  1173. Filesu
  1174. Troi File Plug-in
  1175. D0001
  1176. JCSet Field [ result, External("TrFile-GetFileCreator", "FileSpec" )]
  1177. K=Returns the Creator for the file specified by the FileSpec. 
  1178. MNFileSpec:    the Filespec or path to the file for which you want the information.
  1179. Set Field[result, External("TrFile-GetFileType", "KES:readme" )]
  1180. This will (probably) return "ttxt" which is the Creator for the SimpleText application.
  1181. EXAMPLE 2
  1182. We assume that in your FileMaker file the following fields are defined:
  1183.   creator          text
  1184.   gFilePath        Global, text
  1185. gFilePath should contain the path to the file, for example "Mac HD:Logs:Log 1" (Mac). In ScriptMaker add the following script step:
  1186.     Set Field[creator, External("TrFile-GetFileType", gFilePath )]
  1187. This willBM store the Creator of the file specified by gFilePath in the field "creator".
  1188. Creator:     The Creator of a file is a 4 character code used to designate the application that created a file. For example: FileMaker Pro 4 creates database files with a Creator "FMP3".
  1189. This function is not available in Windows.
  1190. See also the function "TrFile-GetFileType" to get the FileType.
  1191. Returns the Creator for the file specified by the FileSpec. 
  1192. ** FileSpec:    the Filespec or path to the file for which you want the information.
  1193. ** Creator:     The Creator of a file is a 4 character code used to designate the application that created a file. For example: FileMaker Pro 4 creates database files with a Creator "FMP3".
  1194. This function is not available in Windows.
  1195. See also the function "TrFile-GetFileType" to get the FileType.
  1196. ** Set Field[result, External("TrFile-GetFileType"
  1197. , "KES:readme" )]
  1198. This will (probably) return "ttxt" which is the Creator for the SimpleText application.
  1199. EXAMPLE 2
  1200. We assume that in your FileMaker file the following fields are defined:
  1201.   creator          text
  1202.   gFilePath        Global, text
  1203. gFilePath should contain the path to the file, for example "Mac HD:Logs:Log 1" (Mac). In ScriptMaker add the following script step:
  1204.     Set Field[creator, External("TrFile-GetFileType", gFilePath )]
  1205. This will store the Creator of the file specified by gFiC"lePath in the field "creator".
  1206. 4/3/2000
  1207. 4:13:56 PM
  1208. TrFile-GetFileSizef
  1209. FileSpecj
  1210. Filesu
  1211. Troi File Plug-in
  1212. D0001
  1213. J@Set Field [ result, External("TrFile-GetFileSize", "FileSpec" )]
  1214. Returns the file size for the file specified by the FileSpec. The size indicates the size the file is using on the disk, not the actual size of the data and resources.
  1215. M,FileSpec:     the Filespec or path to the file.
  1216. Assume there is a file "Read me" with the text "Hello!" in it. Then:
  1217.   Set Field[MyTextField, External("TrFile-GetFileSize", "Disk:Read me")] 
  1218. returns 1024 (= 1 Kb) which is the size used on disk.
  1219. EXAMPLE 2
  1220. We assume that in your FileMaker file the following fields are defined:
  1221.     gFileSpec        Global, text
  1222.     gSize          Global, number
  1223. gFileSpec should contain the path to an existing file, for example "D:\Readme.txt" (Windows) or "Mac HD:Readme.txt" (Mac). In ScriptMaker add the folloB
  1224. wing scriptstep:
  1225.     Set Field[gSize, External("TrFile-GetFileSize", gFileSpec)]
  1226. This will fill gSize with the total size of the file.
  1227. O2The size (in number of bytes) of the file on disk.
  1228. Returns the file size for the file specified by the FileSpec. The size indicates the size the file is using on the disk, not the actual size of the data and resources.
  1229. ** FileSpec:     the Filespec or path to the file.
  1230. ** The size (in number of bytes) of the file on disk.
  1231. ** Assume there is a file "Read me" with the text "Hello!" in it. Then:
  1232.   Set Field[MyTextField, External("TrFile-GetFileSize", "Disk:Read me")] 
  1233. returns 1024 (= 1 Kb) which is the size used on disk.
  1234. EXAMPLE 2
  1235. assume that in your FileMaker file the following fields are defined:
  1236.     gFileSpec        Global, text
  1237.     gSize          Global, number
  1238. gFileSpec should contain the path to an existing file, for example "D:\Readme.txt" (Windows) or "Mac HD:Readme.txt" (Mac). In ScriptMaker add the following scriptstep:
  1239.     Set Field[gSize, External("TrFile-GetFileSize", gFileSpec)]
  1240. This will fill gSize with the total size of the file.
  1241. 4/3/2000
  1242. 4:13:56 PM
  1243. TrFile-GetFileTypef
  1244. FileSpecj
  1245. Filesu
  1246. Troi File Plug-in
  1247. D0001
  1248. J@Set Field [ result, External("TrFile-GetFileType", "FileSpec" )]
  1249. K<Returns the FileType for the file specified by the FileSpec.
  1250. MNFileSpec:    the Filespec or path to the file for which you want the information.
  1251. Set Field[result, External("TrFile-GetFileType", "KES:test.fp5" )]
  1252. This will (probably) return "FMP5" which is the FileType for FileMaker Pro 5.
  1253. EXAMPLE 2
  1254. We assume that in your FileMaker file the following fields are defined:
  1255.   fileType        text
  1256.   gFilePath        Global, text
  1257. gFilePath should contain the path to the file, for example "Mac HD:Logs:Log 1" (Mac). In ScriptMaker add the following script step:
  1258.     Set Field[fileType, External("TrFile-GetFileType", gFilePath )]
  1259. This will store tBGhe FileType of the file specified by gFilePath in the field "fileType".
  1260. The FileType is a 4 character code used to designate the type of file. For example: FileMaker 4 files have a FileType of "FMP3" and Applications have FileType of "APPL".
  1261. This function is not available in Windows. Windows uses the 3 letter extension, like .fp3 instead.
  1262. Returns the FileType for the file specified by the FileSpec.
  1263. ** FileSpec:    the Filespec or path to the file for which you want the information.
  1264. ** The FileType is a 4 character code used to designate the type of file. For example: FileMaker 4 files have a FileType of "FMP3" and Applications have FileType of "APPL".
  1265. This function is not available in Windows. Windows uses the 3 letter extension, like .fp3 instead.
  1266. ** Set Field[result, External("TrFile-GetFileType", "KES:test.fp5" )]
  1267. s will (probably) return "FMP5" which is the FileType for FileMaker Pro 5.
  1268. EXAMPLE 2
  1269. We assume that in your FileMaker file the following fields are defined:
  1270.   fileType        text
  1271.   gFilePath        Global, text
  1272. gFilePath should contain the path to the file, for example "Mac HD:Logs:Log 1" (Mac). In ScriptMaker add the following script step:
  1273.     Set Field[fileType, External("TrFile-GetFileType", gFilePath )]
  1274. This will store the FileType of the file specified by gFilePath in the field "fileType".C
  1275. 4/3/2000
  1276. 4:13:56 PM
  1277. TrFile-GetResForkSizef
  1278. FileSpecj
  1279. Filesu
  1280. Troi File Plug-in
  1281. D0001
  1282. JCSet Field [ result, External("TrFile-GetResForkSize", "FileSpec" )]
  1283. Returns the size of the resource fork for the file specified by the FileSpec. The size indicates the actual number of bytes used by the resource fork.
  1284. MNFileSpec:    the Filespec or path to the file for which you want the information.
  1285. Assume there is a file "Read me" with the text "Hello!" in it. Then:
  1286.   Set Field[MyTextField, External("TrFile-GetResForkSize", "Disk:Read me")] 
  1287. might return 453 which is the size of the resource fork.
  1288. EXAMPLE 2
  1289. We assume that in your FileMaker file the following fields are defined:
  1290.     gFileSpec        Global, text
  1291.     gSize           Global, number
  1292. gFileSpec should contain the path to an existing file, for example "D:\Readme.txt" (Windows) or "Mac HD:Readme.txt" (Mac). In ScriptMaker add thB
  1293. e following scriptstep:
  1294.     Set Field[gSize, External("TrFile-GetResForkSize", gFileSpec)]
  1295. This will fill gSize with the resource fork size of the file.
  1296. The size (in bytes) of the resource fork of the file specified.  On Mac a file can have a data fork and also a resource fork. In this fork resources, like for example pictures are stored.
  1297. R*This function is not available in Windows.
  1298. Returns the size of the resource fork for the file specified by the FileSpec. The size indicates the actual number of bytes used by the resource fork.
  1299. ** FileSpec:    the Filespec or path to the file for which you want the information.
  1300. ** The size (in bytes) of the resource fork of the file specified.  On Mac a file can have a data fork and also a resource fork. In this fork resources, like for example pictures are stored.
  1301. ** This function is not available in Windows.
  1302. ** Assume there is a f
  1303. ile "Read me" with the text "Hello!" in it. Then:
  1304.   Set Field[MyTextField, External("TrFile-GetResForkSize", "Disk:Read me")] 
  1305. might return 453 which is the size of the resource fork.
  1306. EXAMPLE 2
  1307. We assume that in your FileMaker file the following fields are defined:
  1308.     gFileSpec        Global, text
  1309.     gSize           Global, number
  1310. gFileSpec should contain the path to an existing file, for example "D:\Readme.txt" (Windows) or "Mac HD:Readme.txt" (Mac). In ScriptMaker add the following scripts
  1311.     Set Field[gSize, External("TrFile-GetResForkSize", gFileSpec)]
  1312. This will fill gSize with the resource fork size of the file.
  1313. 4/3/2000
  1314. 4:13:56 PM
  1315. TrFile-GetTimeCreatedf
  1316. FileSpecj
  1317. Filesu
  1318. Troi File Plug-in
  1319. D0001
  1320. JCSet Field [ result, External("TrFile-GetTimeCreated", "FileSpec" )]
  1321. KBReturns the creation time for the file specified by the FileSpec.
  1322. MNFileSpec:    the Filespec or path to the file for which you want the information.
  1323. Set Field[creationTime, External("TrFile-GetTimeCreated", "C:\Test.txt" )]
  1324. This might return the number 7264 which is equivalent to the time: 02:01:04.
  1325. EXAMPLE 2
  1326. We assume that in your FileMaker file the following fields are defined:
  1327.   creationTime        time
  1328.   gFilePath        Global, text
  1329. gFilePath should contain the path to the file for example "D:\Logs\L01.TXT" (Windows) or "Mac HD:Logs:Log 1" (Mac). In ScriptMaker add the following script step:
  1330.     Set Field[creationTime, External("TrFile-
  1331. The returned result is the creation time of the file. The time is in the same format as a time field (number of seconds since 00:00:00). 
  1332. An error code might also be returned. An error always starts with 2 dollars, followed by the error code. Returned error codes can be:
  1333.     $$-43     fnfErr          File not found, check if the path is valid
  1334.     $$-1      genericErr      The file could not be found (older versions of the plug-in)
  1335. Other errors may be returned.
  1336. Returns the creation time for the file specified by the FileSpec.
  1337. ** FileSpec:    the Filespec or path to the file for which you want the information.
  1338. ** The returned result is the creation time of the file. The time is in the same format as a time field (number of seconds since 00:00:00). 
  1339. An error code might also be returned. An error always starts with 2 dollars, followed by the error code. Returned error codes can be:
  1340.     $$-43     fnfErr          File not found, check if the path is valid
  1341.     $$-1      
  1342. NB~GetTimeCreated", gFilePath )]
  1343. This will store the creation time of the file specified by gFilePath in the field creationTime.
  1344. genericErr      The file could not be found (older versions of the plug-in)
  1345. Other errors may be returned.
  1346. ** Set Field[creationTime, External("TrFile-GetTimeCreated", "C:\Test.txt" )]
  1347. This might return the number 7264 which is equivalent to the time: 02:01:04.
  1348. EXAMPLE 2
  1349. We assume that in your FileMaker file the following fields are defined:
  1350.   creationTime        time
  1351.   gFilePath        Global, text
  1352. gFilePath should contain the path to the file for example "D:\Logs\L01.TXT" (Windows) or "Mac HD:C
  1353. Logs:Log 1" (Mac). In ScriptMaker add the following script step:
  1354.     Set Field[creationTime, External("TrFile-GetTimeCreated", gFilePath )]
  1355. This will store the creation time of the file specified by gFilePath in the field creationTime.
  1356. 4/3/2000
  1357. 4:13:57 PM
  1358. TrFile-GetTimeModifiedf
  1359. FileSpecj
  1360. Filesu
  1361. Troi File Plug-in
  1362. D0001
  1363. JDSet Field [ result, External("TrFile-GetTimeModified", "FileSpec" )]
  1364. Returns the modification time for the file specified by the FileSpec. The modification time is also displayed in the Finder or Explorer.
  1365. MNFileSpec:    the Filespec or path to the file for which you want the information.
  1366. Set Field[modificationTime, External("TrFile-GetTimeModified", "C:\Test.txt" )]
  1367. This might return the number 7265 which is equivalent to the time: 02:01:05.
  1368. EXAMPLE 2
  1369. We assume that in your FileMaker file the following fields are defined:
  1370.   modificationTime    time
  1371.   gFilePath        Global, text
  1372. gFilePath should contain the path to the file, for example "D:\Logs\L01.TXT" (Windows) or "Mac HD:Logs:Log 1" (Mac). In ScriptMaker add the following script step:
  1373.     Set Field[modificationTime, ExteB
  1374. rnal("TrFile-GetTimeModified", gFilePath )]
  1375. This will store the modification time of the file specified by gFilePath in the field modificationTime.
  1376. The returned result is the modification time of the file. The time is in the same format as a time field (number of seconds since 00:00:00). 
  1377. An error code may also be returned. An error always starts with 2 dollars, followed by the error code. Returned error codes can be:
  1378.     $$-43     fnfErr          File not found, check if the path is valid
  1379.     $$-1      genericErr      The file could not be found (older versions of the plug-in)
  1380. Other errors may be returned.
  1381. Returns the modification time for the file specified by the FileSpec. The modification time is also displayed in the Finder or Explorer.
  1382. ** FileSpec:    the Filespec or path to the file for which you want the information.
  1383. ** The returned result is the modification time of the file. The time is in the same format as a time field (number of seconds since 00:00:00). 
  1384. An error code may also be returned. An error always starts with 2 dollars, followed by the error code. Returned error codes can 
  1385.     $$-43     fnfErr          File not found, check if the path is valid
  1386.     $$-1      genericErr      The file could not be found (older versions of the plug-in)
  1387. Other errors may be returned.
  1388. ** Set Field[modificationTime, External("TrFile-GetTimeModified", "C:\Test.txt" )]
  1389. This might return the number 7265 which is equivalent to the time: 02:01:05.
  1390. EXAMPLE 2
  1391. We assume that in your FileMaker file the following fields are defined:
  1392.   modificationTime    time
  1393.   gFilePath        Global, text
  1394. gFilePath should
  1395. P contain the path to the file, for example "D:\Logs\L01.TXT" (Windows) or "Mac HD:Logs:Log 1" (Mac). In ScriptMaker add the following script step:
  1396.     Set Field[modificationTime, External("TrFile-GetTimeModified", gFilePath )]
  1397. This will store the modification time of the file specified by gFilePath in the field modificationTime.
  1398. 4/3/2000
  1399. 4:13:57 PM
  1400. TrFile-Launchf
  1401. FileSpecj
  1402. Filesu
  1403. Troi File Plug-in
  1404. D0001
  1405. J;Set Field [ result, External("TrFile-Launch", "FileSpec" )]
  1406. Opens a file with the application that has registered it. This is the same application that would open it if you would manually double-click it.
  1407. M;fileSpec:     the Filespec or path to the file to be launched.
  1408. Set Field[result, External("TrFile-Launch", "C:\readme.doc" )]
  1409. This will open the file in the application Microsoft Word.
  1410. EXAMPLE 2
  1411. We assume that in your FileMaker file the following fields are defined:
  1412.   gErrorCode        Global, number
  1413.   gFilePath        Global, text
  1414. gFilePath should contain the path to the file, for example "D:\Logs\L01.TXT" (Windows) or "Mac HD:Logs:Log 1" (Mac). In ScriptMaker add the following script step:
  1415.     Set Field[gErrorCode, External("TrFile-Launch", gFilePath )]
  1416. BFThis will launch the file specified by gFilePath with its application.
  1417. The returned result is an error code. An error always starts with 2 dollars, followed by the error code. You should always check for errors. Returned error codes can be:
  1418.     0    no error       The file was opened with its application
  1419.     $$-35     nsVolErr    No such volume (Wrong disk name or not mounted).
  1420.     $$-43    fnfErr        File not found.
  1421.     $$-50     paramErr    Parameter error.
  1422.     $$-1      genericErr      The file could not be opened.
  1423. Other errors may be returned.
  1424. On the Mac the program that opens the file is determined by the FileType of the file. 
  1425. On Windows this is determined by the 3 letter extension of the file. 
  1426. So a text file "ReadMe.txt" will usually be opened by SimpleText (Mac) or WordPad (Windows).
  1427. Opens a file with the application that has registered it. This is the same application that would open it if you would manually double-click it.
  1428. ** fileSpec:     the Filespec or path to the file to be launched.
  1429. ** The returned result is an error code. An error always starts with 2 dollars, followed by the error code. You should always check for errors. Returned error codes can be:
  1430.     0    no error       The file was opened with its application
  1431.     $$-35     nsVolErr    No such volume (Wrong disk name or not m
  1432. ounted).
  1433.     $$-43    fnfErr        File not found.
  1434.     $$-50     paramErr    Parameter error.
  1435.     $$-1      genericErr      The file could not be opened.
  1436. Other errors may be returned.
  1437. ** On the Mac the program that opens the file is determined by the FileType of the file. 
  1438. On Windows this is determined by the 3 letter extension of the file. 
  1439. So a text file "ReadMe.txt" will usually be opened by SimpleText (Mac) or WordPad (Windows).
  1440. ** Set Field[result, External("TrFile-Launch", "C:\readme.doc" )]
  1441. This will open the
  1442.  file in the application Microsoft Word.
  1443. EXAMPLE 2
  1444. We assume that in your FileMaker file the following fields are defined:
  1445.   gErrorCode        Global, number
  1446.   gFilePath        Global, text
  1447. gFilePath should contain the path to the file, for example "D:\Logs\L01.TXT" (Windows) or "Mac HD:Logs:Log 1" (Mac). In ScriptMaker add the following script step:
  1448.     Set Field[gErrorCode, External("TrFile-Launch", gFilePath )]
  1449. This will launch the file specified by gFilePath with its application.
  1450. 4/3/2000
  1451. 4:13:57 PM
  1452. TrFile-MoveFilef
  1453. 1i&source FileSpec | destination FileSpecj
  1454. Filesu
  1455. Troi File Plug-in
  1456. D0001
  1457. J[Set Field [ result, External("TrFile-MoveFile", "source FileSpec | destination FileSpec" )]
  1458. K=Moves (or renames) a file from one disk location to another.
  1459. Mpsource FileSpec:    the path to the file to move.
  1460. destination FileSpec:    the path where the file must be moved to.
  1461. We assume that in your FileMaker file the following fields are defined:
  1462.   gErrorCode        Global, number
  1463.   gSourceFilePath    Global, text
  1464.   gDestFilePath        Global, text
  1465. gSourceFilePath should contain the path to an existing file, for example "D:\Logs\Log01.TXT" (Windows) or "Mac HD:Logs:Log 1" (Mac).  gDestFilePath should contain the path to the destination and should not exist for example "D:\New\L2000_01.TXT" (Windows) or "Mac HD:New:Log 2000_01" (Mac). In ScriptMaker add the following script
  1466. step:
  1467.     Set Field[gErrorCode, External("TrFile-MoveFile", gSourceFilePath & "|" & gDestFilePath )]
  1468. This will move the source file to the path indicated in the gDestFilePath.
  1469. EXAMPLE 2
  1470. Renaming a file: assume your C disk already contains a file "Testtext.txt". We assume that a global number field gErrorCode is defined. In ScriptMaker create the following script:
  1471.     Set Field[gErrorCode, External("TrFile-MoveFile", "C:\Testtext.txt|C:\NewName.txt" )]
  1472. This script will move (rena
  1473. me) the file "Testtext.txt"  to  the "NewName.txt" file in the same directory. Note that on Mac OS the paths will be like: "Work Disk:NewName.txt".
  1474. The returned result is an error code. An error always starts with 2 dollars, followed by the error code. You should always check for errors. Returned error codes can be:
  1475.     0    no error       The file was moved
  1476.     $$-43     fnfErr          Source file not found, or destination directory does not exist
  1477.     $$-48      dupFNErr      Destination file already exists
  1478.     $$-1      genericErr      The file could not be moved
  1479. Other errors may be returned.
  1480. TIP: You can also use this function to rename a file
  1481. See also the functions "TrFile-Get FileSpec Dialog" and "TrFile-Save FileSpec Dialog" to get a FileSpec for a file.
  1482. This function only works for source and destination on the same disk.
  1483. Moves (or renames) a file from one disk location to another.
  1484. ** source FileSpec:    the path to the file to move.
  1485. destination FileSpec:    the path where the file must be moved to.
  1486. ** The returned result is an error code. An error always starts with 2 dollars, followed by the error code. You should always check for errors. Returned error codes can be:
  1487.     0    no error       The file was moved
  1488.     $$-43     fnfErr          Source file not found, or destination directory does not exist
  1489.     $$-48      dupFNErr      Destina
  1490. tion file already exists
  1491.     $$-1      genericErr      The file could not be moved
  1492. Other errors may be returned.
  1493. ** TIP: You can also use this function to rename a file
  1494. See also the functions "TrFile-Get FileSpec Dialog" and "TrFile-Save FileSpec Dialog" to get a FileSpec for a file.
  1495. This function only works for source and destination on the same disk.
  1496. ** We assume that in your FileMaker file the following fields are defined:
  1497.   gErrorCode        Global, number
  1498.   gSourceFilePath    Global, text
  1499.   gDestFil
  1500. ePath        Global, text
  1501. gSourceFilePath should contain the path to an existing file, for example "D:\Logs\Log01.TXT" (Windows) or "Mac HD:Logs:Log 1" (Mac).  gDestFilePath should contain the path to the destination and should not exist for example "D:\New\L2000_01.TXT" (Windows) or "Mac HD:New:Log 2000_01" (Mac). In ScriptMaker add the following scriptstep:
  1502.     Set Field[gErrorCode, External("TrFile-MoveFile", gSourceFilePath & "|" & gDestFilePath )]
  1503. This will move the source file to the p
  1504. ath indicated in the gDestFilePath.
  1505. EXAMPLE 2
  1506. Renaming a file: assume your C disk already contains a file "Testtext.txt". We assume that a global number field gErrorCode is defined. In ScriptMaker create the following script:
  1507.     Set Field[gErrorCode, External("TrFile-MoveFile", "C:\Testtext.txt|C:\NewName.txt" )]
  1508. This script will move (rename) the file "Testtext.txt"  to  the "NewName.txt" file in the same directory. Note that on Mac OS the paths will be like: "Work Disk:NewName.
  1509. TE    txt".
  1510. 4/3/2000
  1511. 4:13:57 PM
  1512. TrFile-Save FileSpec Dialogf
  1513. prompt|default_file_namej
  1514. Filesu
  1515. Troi File Plug-in
  1516. D0001
  1517. JeSet Field [ result, External("TrFile-Save FileSpec Dialog", "prompt | defaultName | initialFolder" )]
  1518. Presents the user with a dialog, in which the user can specify where to save a file. The function returns with the FileSpec of the chozen file. Use this FileSpec for other File plug-in functions.
  1519. prompt:    the prompt that will be displayed to instruct the user.
  1520. defaultName    (optional) the default file name of the file to be saved.
  1521. initialFolder:    (optional) the FileSpec or path to the folder where the dialog initially starts.
  1522. 9  Set Field[myFileName, External("TrFile-Save FileSpec Dialog", 
  1523.             "Please choose a file to create|myFile.txt|" & gInititialDir)] 
  1524.   If [Left(myFileName, 2) <> "$$"]
  1525.     Set Field[gErrorCode, External("TrFile-CreateFile", myFileName )]
  1526.   Endif
  1527. This will ask the user for a file to create, which is then created.
  1528. FileSpec:     The function returns a FileSpec for the selected file.
  1529. Use this FileSpec as the basis for other File plug-in functions.
  1530. If the user cancels an error code of "$$-1" is returned.
  1531. Presents the user with a dialog, in which the user can specify where to save a file. The function returns with the FileSpec of the chozen file. Use this FileSpec for other File plug-in functions.
  1532. ** prompt:    the prompt that will be displayed to instruct the user.
  1533. defaultName    (optional) the default file name of the file to be saved.
  1534. initialFolder:    (optional) the FileSpec or path to the folder where the dialog initially starts.
  1535. ** FileSpec:     The function returns a FileSpec for the selected fi
  1536. Use this FileSpec as the basis for other File plug-in functions.
  1537. If the user cancels an error code of "$$-1" is returned.
  1538. **   Set Field[myFileName, External("TrFile-Save FileSpec Dialog", 
  1539.             "Please choose a file to create|myFile.txt|" & gInititialDir)] 
  1540.   If [Left(myFileName, 2) <> "$$"]
  1541.     Set Field[gErrorCode, External("TrFile-CreateFile", myFileName )]
  1542.   Endif
  1543. This will ask the user for a file to create, which is then created.
  1544. 4/3/2000
  1545. 4:13:57 PM
  1546. TrFile-Searchf
  1547. switches | Volume | SearchNamej
  1548. Filesu
  1549. Troi File Plug-in
  1550. D0001
  1551. JQSet Field [ result, External("TrFile-Search", "switches | Volume | SearchName" )]
  1552. K8Search a volume (disk) for a file or folder (directory).
  1553. switches:     these determine the items that are listed.
  1554. volume:     the name of the volume on which to search
  1555. searchName    the (part of the) filename or foldername you want to find
  1556. switches can be one or more of the following:
  1557. files        search for files
  1558. folders        search for folders
  1559. exactname        the filename must exactly match the searchname
  1560. showaliases    search also aliases (shortcuts)
  1561. showshortcuts    search also aliases (shortcuts) (you can use the one you like)
  1562. showinvisibles    search also invisiblB
  1563. e files and folders
  1564.    Set Field [ result, External("TrFile-Search",  "files &folders |KES: |readme")]
  1565. This will return a list of all files and folders on the hard disk "Mac HD" with the name 'readme'. Note that the order of the switches is not relevant, and also the & is just there for readability. This might be returned:
  1566.     KES:Foto, film, geluid:Geluiden:Alert!!!:Readme
  1567.     KES:Programma's:Beeld:GIFConverter 2.3.7 
  1568. :README-registration
  1569.     KES:Programma's:Beeld:
  1570. MOVIE:OBJTOOL:README, Make QTVR Object
  1571.     etc...Bp
  1572. On Windows an example use is:
  1573.    Set Field [ result, External("TrFile-Search",  "files &folders |C:|readme")]
  1574. O:paths        a list of paths of the items separated by returns. 
  1575. At the moment you can only search a complete volume.
  1576. Search a volume (disk) for a file or folder (directory).
  1577. ** switches:     these determine the items that are listed.
  1578. volume:     the name of the volume on which to search
  1579. searchName    the (part of the) filename or foldername you want to find
  1580. switches can be one or more of the following:
  1581. files        search for files
  1582. folders        search for folders
  1583. exactname        the filename must exactly match the searchname
  1584. showaliases    search also aliases (shortcuts)
  1585. showshortcuts    search also aliases (shortcuts) (you c
  1586. an use the one you like)
  1587. showinvisibles    search also invisible files and folders
  1588. ** paths        a list of paths of the items separated by returns. 
  1589. At the moment you can only search a complete volume.
  1590. **    Set Field [ result, External("TrFile-Search",  "files &folders |KES: |readme")]
  1591. This will return a list of all files and folders on the hard disk "Mac HD" with the name 'readme'. Note that the order of the switches is not relevant, and also the & is just there for readability. This migh
  1592. ?t be returned:
  1593.     KES:Foto, film, geluid:Geluiden:Alert!!!:Readme
  1594.     KES:Programma's:Beeld:GIFConverter 2.3.7 
  1595. :README-registration
  1596.     KES:Programma's:Beeld:
  1597. MOVIE:OBJTOOL:README, Make QTVR Object
  1598.     etc...
  1599. On Windows an example use is:
  1600.    Set Field [ result, External("TrFile-Search",  "files &folders |C:|readme")]
  1601. 4/3/2000
  1602. 4:13:57 PM
  1603. TrFile-SetContentsf
  1604. FileSpecj
  1605. Filesu
  1606. Troi File Plug-in
  1607. D0001
  1608. J<Set Field [ result, External("TrFile-SetContents", "text" )]
  1609. KUSets the contents of an existing file indicated by the 
  1610. SetDefaultFileSpec
  1611.  function.
  1612. M8text: the characters that you want to write in the file.
  1613. Assume your C disk already contains a file "Testtext.txt" which is empty. We assume that a global number field gErrorCode is defined. In ScriptMaker create the following script:
  1614.     Set Field[gErrorCode, External("TrFile-SetDefaultFileSpec", "C:\Testtext.txt" )]
  1615.     Set Field[gErrorCode, External("TrFile-SetContents", "Hello there." )]
  1616. This script will set the contents of the file "C:\Testtext.txt" to the text "Hello there.".
  1617. EXAMPLE 2
  1618. We assume that in your FileMaker file the following fiel
  1619. ds are defined:
  1620.   gErrorCode        Global, number
  1621.   gFilePath        Global, text
  1622.   textField        text 
  1623. gFilePath should contain the path to an existing file, for example "D:\Hello.TXT" (Windows) or "Disk1:Hello" (Mac). TextField contains the text you want to write. In ScriptMaker add the following scriptstep:
  1624.    Set Field[gErrorCode, External("TrFile-SetDefaultFileSpec", gFilePath )]
  1625.    Set Field[gErrorCode, External("TrFile-SetContents",   textField)]
  1626. This will set the default file to your file. Th
  1627. NC$en the text is written to the file. 
  1628. oThe returned result is an error code. An error always starts with 2 dollars, followed by the error code. You should always check for errors. Returned error codes can be:
  1629.     0    no error       The string of characters was written in the file
  1630.     $$-1      genericErr      The file could not be opened for writing (You may need to create the file first).
  1631. Other errors may be returned.
  1632. See also the functions:
  1633. "TrFile-Save FileSpec Dialog" to get a FileSpec for the file, 
  1634. TrFile-SetDefaultFileSpec
  1635.  to indicate the file to affect.
  1636. Sets the contents of an existing file indicated by the 
  1637. SetDefaultFileSpec
  1638.  function.
  1639. ** text: the characters that you want to write in the file.
  1640. ** The returned result is an error code. An error always starts with 2 dollars, followed by the error code. You should always check for errors. Returned error codes can be:
  1641.     0    no error       The string of characters was written in the file
  1642.     $$-1      genericErr      The file could not be opened for writing (You may need to create the file first).
  1643. Other e
  1644. rrors may be returned.
  1645. ** See also the functions:
  1646. "TrFile-Save FileSpec Dialog" to get a FileSpec for the file, 
  1647. TrFile-SetDefaultFileSpec
  1648.  to indicate the file to affect.
  1649. ** Assume your C disk already contains a file "Testtext.txt" which is empty. We assume that a global number field gErrorCode is defined. In ScriptMaker create the following script:
  1650.     Set Field[gErrorCode, External("TrFile-SetDefaultFileSpec", "C:\Testtext.txt" )]
  1651.     Set Field[gErrorCode, External("TrFile-SetContents", "He
  1652. llo there." )]
  1653. This script will set the contents of the file "C:\Testtext.txt" to the text "Hello there.".
  1654. EXAMPLE 2
  1655. We assume that in your FileMaker file the following fields are defined:
  1656.   gErrorCode        Global, number
  1657.   gFilePath        Global, text
  1658.   textField        text 
  1659. gFilePath should contain the path to an existing file, for example "D:\Hello.TXT" (Windows) or "Disk1:Hello" (Mac). TextField contains the text you want to write. In ScriptMaker add the following scriptstep:
  1660.    Set Field[gErroD
  1661. rCode, External("TrFile-SetDefaultFileSpec", gFilePath )]
  1662.    Set Field[gErrorCode, External("TrFile-SetContents",   textField)]
  1663. This will set the default file to your file. Then the text is written to the file. 
  1664. 4/3/2000
  1665. 4:13:57 PM
  1666. TrFile-SetDefaultCreatorf
  1667. FileSpecj
  1668. Filesu
  1669. Troi File Plug-in
  1670. D0001
  1671. JESet Field [ result, External("TrFile-SetDefaultCreator", "Creator" )]
  1672. Specifies the file creator to be used when creating a new file. This creator will be used for subsequent calls to "TrFile-CreateFile".
  1673. Creator:     The Creator of a file is a 4 character code used to designate the application that created a file. For example: use "ttxt" to create a SimpleText text file. 
  1674. We assume that in your FileMaker file the following fields are defined:
  1675.   gErrorCode        Global, number
  1676.   gFilePath        Global, text
  1677.   textField        text 
  1678. gFilePath should contain the path to an existing file, for example "D:\Hello.TXT" (Windows) or "Disk1:Hello" (Mac). TextField contains the text you want to write. In ScriptMaker add the following scriptstep:
  1679.    Set Field[gErrorCode, External("TrFile-SetDefaultFileSpec", gFilePath )]
  1680.    Set Field[gErrorCode, External("TrFile-SetDefaultCreator", 
  1681.   "ttxt")]
  1682.    Set Field[gErrorCode, External("TrFile-SetDefaultFileType",  "TEXT")]
  1683.    Set Field[gErrorCode, External("TrFile-SetContents",   textField)]
  1684. This will set the default file to your file with a SimpleText FileType and Creator. Then the text is written to the file. 
  1685. OZThis function does not return anything at the moment. This may change in a future version.
  1686. RcSee also the function "TrFile-CreateFile" to create a new empty file.
  1687. Mac only. Ignored on Windows.
  1688. Specifies the file creator to be used when creating a new file. This creator will be used for subsequent calls to "TrFile-CreateFile".
  1689. ** Creator:     The Creator of a file is a 4 character code used to designate the application that created a file. For example: use "ttxt" to create a SimpleText text file. 
  1690. ** This function does not return anything at the moment. This may change in a future version.
  1691. ** See also the function "TrFile-CreateFile" to create a new empty file.
  1692. Mac only. Ignored on
  1693.  Windows.
  1694. ** We assume that in your FileMaker file the following fields are defined:
  1695.   gErrorCode        Global, number
  1696.   gFilePath        Global, text
  1697.   textField        text 
  1698. gFilePath should contain the path to an existing file, for example "D:\Hello.TXT" (Windows) or "Disk1:Hello" (Mac). TextField contains the text you want to write. In ScriptMaker add the following scriptstep:
  1699.    Set Field[gErrorCode, External("TrFile-SetDefaultFileSpec", gFilePath )]
  1700.    Set Field[gErrorCode, External("TrFile-SetDefa
  1701. &ultCreator",   "ttxt")]
  1702.    Set Field[gErrorCode, External("TrFile-SetDefaultFileType",  "TEXT")]
  1703.    Set Field[gErrorCode, External("TrFile-SetContents",   textField)]
  1704. This will set the default file to your file with a SimpleText FileType and Creator. Then the text is written to the file. 
  1705. 4/3/2000
  1706. 4:13:57 PM
  1707. TrFile-SetDefaultFileSpecf
  1708. FileSpecj
  1709. Filesu
  1710. Troi File Plug-in
  1711. D0001
  1712. JGSet Field [ result, External("TrFile-SetDefaultFileSpec", "FileSpec" )]
  1713. KhIndicates a FileSpec (i.e. the file) to be used in succeeding functions where no FileSpec is indicated.
  1714. M,FileSpec:     the Filespec or path to the file.
  1715. We assume that in your FileMaker file the following fields are defined:
  1716.   gErrorCode        Global, number
  1717.   gFilePath        Global, text
  1718.   textField        text 
  1719. gFilePath should contain the path to an existing file, for example "D:\Hello.TXT" (Windows) or "Disk1:Hello" (Mac). TextField contains the text you want to write. In ScriptMaker add the following scriptsteps:
  1720.    Set Field[gErrorCode, External("TrFile-SetDefaultFileSpec", gFilePath )]
  1721.    Set Field[gErrorCode, External("TrFile-SetDefaultCreator",
  1722.    "ttxt")]
  1723.    Set Field[gErrorCode, External("TrFile-SetDefaultFileType",  "TEXT")]
  1724.    Set Field[gErrorCode, External("TrFile-SetContents",   textField)]
  1725. This will set the default file to your file with a SimpleText FileType and Creator. Then the text is written to the file. 
  1726. OZThis function does not return anything at the moment. This may change in a future version.
  1727. Indicates a FileSpec (i.e. the file) to be used in succeeding functions where no FileSpec is indicated.
  1728. ** FileSpec:     the Filespec or path to the file.
  1729. ** This function does not return anything at the moment. This may change in a future version.
  1730. ** We assume that in your FileMaker file the following fields are defined:
  1731.   gErrorCode        Global, number
  1732.   gFilePath        Global, text
  1733.   textField        text 
  1734. gFilePath should contain the path to an existing file, for example "D:\Hello.TXT" (Windows) o
  1735. r "Disk1:Hello" (Mac). TextField contains the text you want to write. In ScriptMaker add the following scriptsteps:
  1736.    Set Field[gErrorCode, External("TrFile-SetDefaultFileSpec", gFilePath )]
  1737.    Set Field[gErrorCode, External("TrFile-SetDefaultCreator",   "ttxt")]
  1738.    Set Field[gErrorCode, External("TrFile-SetDefaultFileType",  "TEXT")]
  1739.    Set Field[gErrorCode, External("TrFile-SetContents",   textField)]
  1740. This will set the default file to your file with a SimpleText FileType and Creator. C*Then the text is written to the file. 
  1741. 4/3/2000
  1742. 4:13:57 PM
  1743. TrFile-SetDefaultTypef
  1744. 1i&[FileType1FileType2FileType3FileType4]j
  1745. Filesu
  1746. Troi File Plug-in
  1747. D0001
  1748. JaSet Field [ result, External("TrFile-SetDefaultType", "[FileType1FileType2FileType3FileType4]" )]
  1749. K{Sets the FileType to be displayed when browsing GetFile dialogs. Also sets the default file type when creating new files. 
  1750. If no parameter is specified, the "TrFile-Get FileSpec Dialog" in the new function will display all files. 
  1751. Individual file type must contain 4 characters and is case sensitive. Add more file types without separators.
  1752. Set Field[gButtonNr, External("TrFile-SetDefaultType", "TEXTttro") to display SimpleText and Teach Text read-only files.
  1753. EXAMPLE 2
  1754. We assume that in your FileMaker file the following fields are defined:
  1755.   gErrorCode        Global, number
  1756.   gFilePath        Global, text
  1757.   textField        text 
  1758. gFilePath should contain the path to an existing file, for example "D:\Hello.TXT" (Windows) or "Disk1:Hello" (Mac). TextField contains the text you want to write. In ScriptMaker add the following scriptsteps:
  1759. et Field[gErrorCode, External("TrFile-SetDefaultFileSpec", gFilePath )]
  1760.    Set Field[gErrorCode, External("TrFile-SetDefaultCreator",   "ttxt")]
  1761.    Set Field[gErrorCode, External("TrFile-SetDefaultType",  "TEXT")]
  1762.    Set Field[gErrorCode, External("TrFile-SetContents",   textField)]
  1763. This will set the default file to your file with a SimpleText FileType and Creator. Then the text is written to the file. 
  1764. OZThis function does not return anything at the moment. This may change in a future version.
  1765. RcSee also the function "TrFile-CreateFile" to create a new empty file.
  1766. Mac only. Ignored on Windows.
  1767. Sets the FileType to be displayed when browsing GetFile dialogs. Also sets the default file type when creating new files. 
  1768. ** If no parameter is specified, the "TrFile-Get FileSpec Dialog" in the new function will display all files. 
  1769. Individual file type must contain 4 characters and is case sensitive. Add more file types without separators.
  1770. ** This function does not return anything at the moment. This may change in a future version.
  1771. ** See also the function "TrFile-CreateFile" to create
  1772.  a new empty file.
  1773. Mac only. Ignored on Windows.
  1774. ** Set Field[gButtonNr, External("TrFile-SetDefaultType", "TEXTttro") to display SimpleText and Teach Text read-only files.
  1775. EXAMPLE 2
  1776. We assume that in your FileMaker file the following fields are defined:
  1777.   gErrorCode        Global, number
  1778.   gFilePath        Global, text
  1779.   textField        text 
  1780. gFilePath should contain the path to an existing file, for example "D:\Hello.TXT" (Windows) or "Disk1:Hello" (Mac). TextField contains the text you want to write.
  1781.  In ScriptMaker add the following scriptsteps:
  1782.    Set Field[gErrorCode, External("TrFile-SetDefaultFileSpec", gFilePath )]
  1783.    Set Field[gErrorCode, External("TrFile-SetDefaultCreator",   "ttxt")]
  1784.    Set Field[gErrorCode, External("TrFile-SetDefaultType",  "TEXT")]
  1785.    Set Field[gErrorCode, External("TrFile-SetContents",   textField)]
  1786. This will set the default file to your file with a SimpleText FileType and Creator. Then the text is written to the file. 
  1787. 4/3/2000
  1788. 4:13:57 PM
  1789. TrFile-ThumbnailToClipf
  1790. switches | FileSpecj
  1791. Filesu
  1792. Troi File Plug-in
  1793. D0001
  1794. JOSet Field [ result, External("TrFile-ThumbnailToClip", "switches | FileSpec" )]
  1795. KfCreates a thumbnail (a small image of 80x80 pixels) from a graphics file and puts it on the clipboard.
  1796. switches:     reserved for future use., leave empty or set to "-unused"    .
  1797. FileSpec:     the Filespec or path to the file from which to create a thumbnail.
  1798.    Go To Layout[container Layout]
  1799.    Set Field [ result, External("TrFile-ThumbnailToClip", "-unused | Mac HD:photo.jpeg" )]
  1800.    Paste[container field]
  1801. This will create a thumbnail and put it in a container field
  1802. EXAMPLE 2
  1803. Say you want to create the thumbnails of filepaths that are stored in a set of records. We assume that in your FileMaker file the following fields are defined:
  1804.   gErrorCode        Global, number
  1805.   filePath        text, contains the path to a file
  1806.   thumbnailField        container
  1807. lePath should contain the full path to existing files, for example "Mac HD:Aap.JPG" (Mac). In ScriptMaker add the following script steps:
  1808.    Go To Layout[ container Layout]
  1809.    Go to Record[first]
  1810.    Loop 
  1811.        Set Field[gErrorCode, External("TrFile-ThumbnailToClip", "-unused|" & filePath)]
  1812.        Paste[thumbnailField]
  1813.        Go to Record[next, exit after last]
  1814.    End Loop
  1815. This will try to create thumbnails for all files for the records of the found set.
  1816. The returned result is an error code. An error always starts with 2 dollars, followed by the error code. You should always check for errors. Returned error codes can be:
  1817.     0               no error               The thumbnail was created
  1818.     $$-2020        movieToolboxUninitialized    QuickTime not available 
  1819.     $$-2003        cantFindHandler            No thumbnail could be created
  1820.     $$-1        genericErr                 (Windows) function not available in this version
  1821. Other errors may be returned.
  1822. An error code $$-2003 is returned when you try to create a thumbnail for a file that has no graphics, for example a text file or a spreadsheet. It is no problem if you don't know if a file has a thumbnail. Just try to create a thumbnail, if you get the error $$-2003 you know it is not possible.
  1823. NOTE1: When you want to paste from the clipboard the container field needs to be on the current layout.
  1824. NOTE2: When unsuccessful the clipboard can still be emptied by the plug-in.
  1825. You need to hav
  1826. RBEe QuickTime installed in order to view the pictures in the database!
  1827. Creates a thumbnail (a small image of 80x80 pixels) from a graphics file and puts it on the clipboard.
  1828. ** switches:     reserved for future use., leave empty or set to "-unused"    .
  1829. FileSpec:     the Filespec or path to the file from which to create a thumbnail.
  1830. ** The returned result is an error code. An error always starts with 2 dollars, followed by the error code. You should always check for errors. Returned error codes can be:
  1831.     0               no error               The thumbnail was created
  1832.     $$-2020    
  1833.     movieToolboxUninitialized    QuickTime not available 
  1834.     $$-2003        cantFindHandler            No thumbnail could be created
  1835.     $$-1        genericErr                 (Windows) function not available in this version
  1836. Other errors may be returned.
  1837. ** An error code $$-2003 is returned when you try to create a thumbnail for a file that has no graphics, for example a text file or a spreadsheet. It is no problem if you don't know if a file has a thumbnail. Just try to create a thumbnail, if you get the error $$-2003 you kn
  1838. ow it is not possible.
  1839. NOTE1: When you want to paste from the clipboard the container field needs to be on the current layout.
  1840. NOTE2: When unsuccessful the clipboard can still be emptied by the plug-in.
  1841. You need to have QuickTime installed in order to view the pictures in the database!
  1842. **    Go To Layout[container Layout]
  1843.    Set Field [ result, External("TrFile-ThumbnailToClip", "-unused | Mac HD:photo.jpeg" )]
  1844.    Paste[container field]
  1845. This will create a thumbnail and put it in a con
  1846. tainer field
  1847. EXAMPLE 2
  1848. Say you want to create the thumbnails of filepaths that are stored in a set of records. We assume that in your FileMaker file the following fields are defined:
  1849.   gErrorCode        Global, number
  1850.   filePath        text, contains the path to a file
  1851.   thumbnailField        container
  1852. filePath should contain the full path to existing files, for example "Mac HD:Aap.JPG" (Mac). In ScriptMaker add the following script steps:
  1853.    Go To Layout[ container Layout]
  1854.    Go to Record[first]
  1855. Loop 
  1856.        Set Field[gErrorCode, External("TrFile-ThumbnailToClip", "-unused|" & filePath)]
  1857.        Paste[thumbnailField]
  1858.        Go to Record[next, exit after last]
  1859.    End Loop
  1860. This will try to create thumbnails for all files for the records of the found set.
  1861. 4/3/2000
  1862. 4:13:57 PM
  1863. TrFile-Versionf
  1864. nonej
  1865. Filesu
  1866. Troi File Plug-in
  1867. D0001
  1868. J4Set Field [ result, External("TrFile-Version", "") ]
  1869. K{Use this function to see which version of the plug-in is loaded. 
  1870. Note: This function is also used to register the plug-in.
  1871. M*No parameters, leave empty for future use.
  1872. We assume that a calculation number field cVersion is defined like this:
  1873.     cVersion = External("TrFile-Version, "") 
  1874. This will evaluate to "Troi File Plug-in <version number>". This currently returns "Troi File Plug-in 2.0b1".
  1875. OkThe name and version number of the loaded plug-in.
  1876. The function returns "" if this plug-in is not loaded.
  1877. Important: always use this function to determine if the plug-in is loaded. If the plug-in is not loaded use of external functions may result in data loss, as FileMaker will return an empty field to any external function that is not loaded.
  1878. Use this function to see which version of the plug-in is loaded. 
  1879. Note: This function is also used to register the plug-in.
  1880. ** No parameters, leave empty for future use.
  1881. ** The name and version number of the loaded plug-in.
  1882. The function returns "" if this plug-in is not loaded.
  1883. ** Important: always use this function to determine if the plug-in is loaded. If the plug-in is not loaded use of external functions may result in data loss, as FileMaker will return an empty field to any external
  1884.  function that is not loaded.
  1885. ** We assume that a calculation number field cVersion is defined like this:
  1886.     cVersion = External("TrFile-Version, "") 
  1887. This will evaluate to "Troi File Plug-in <version number>". This currently returns "Troi File Plug-in 2.0b1".
  1888. 4/3/2000
  1889. 4:13:57 PM
  1890. TrFile-SelectFolderDialogf
  1891. Troi File Plug-in
  1892. J`Set Field [ result, External("TrFile-SelectFolderDialog", "switches | prompt | path to start" )]
  1893. With this function the user can select a folder on disk. The function will show the user a standard dialog with the hierarcy of folders on the computer. 
  1894. switches:     reserved for future use, leave empty or set to "-unused".
  1895. prompt:      the prompt that will be displayed to tell the user which folder to select.
  1896. path to start:    the path to a folder on disk that will be used as the starting point for the selection dialog.
  1897.     Set Field[result, External("TrFile-SelectFolderDialog", 
  1898.                                 "-unused |Please choose a folder where you want to put the files.|C:\Data\")] 
  1899. This will present a folder selection dialog. The dialog initially shows the folder: "C:\Data\". The user can then select a folder and click on OK. The function returns with the path to the folder, for example: "D:\MyFiles\Databases\".
  1900. EXAMPLE 2
  1901. We assume that in your FileMaker file the following fields are defined:
  1902. gFolderPath        Global, text
  1903.   gInitialFolder        Global, text
  1904. gInitialFolder should contain the path to a folder, for example "D:\Logs\Data\" (Windows) or "Mac HD:Logs:Data:" (Mac OS). In ScriptMaker add the following script step:
  1905.     Set Field[gFolderPath, External("TrFile-SelectFolderDialog", 
  1906.                 "-unused |Please choose a folder where you want to put the files.|" &gInitialFolder)] 
  1907. After the dialog gFolderPath will contain the path to the selected folder.
  1908. FileSpec:     The function returns a FileSpec for the selected folder. This folder can be used
  1909.         with other functions of the plug-in.
  1910. If the user cancels an error code of "$$-1" is returned.
  1911. With this function the user can select a folder on disk. The function will show the user a standard dialog with the hierarcy of folders on the computer. 
  1912. ** switches:     reserved for future use, leave empty or set to "-unused".
  1913. prompt:      the prompt that will be displayed to tell the user which folder to select.
  1914. path to start:    the path to a folder on disk that will be used as the starting point for the selection dialog.
  1915. ** FileSpec:     The function returns a FileSpec for the selected folder. Th
  1916. is folder can be used
  1917.         with other functions of the plug-in.
  1918. If the user cancels an error code of "$$-1" is returned.
  1919. **     Set Field[result, External("TrFile-SelectFolderDialog", 
  1920.                                 "-unused |Please choose a folder where you want to put the files.|C:\Data\")] 
  1921. This will present a folder selection dialog. The dialog initially shows the folder: "C:\Data\". The user can then select a folder and click on OK. The function returns with the path to the folder
  1922. , for example: "D:\MyFiles\Databases\".
  1923. EXAMPLE 2
  1924. We assume that in your FileMaker file the following fields are defined:
  1925.   gFolderPath        Global, text
  1926.   gInitialFolder        Global, text
  1927. gInitialFolder should contain the path to a folder, for example "D:\Logs\Data\" (Windows) or "Mac HD:Logs:Data:" (Mac OS). In ScriptMaker add the following script step:
  1928.     Set Field[gFolderPath, External("TrFile-SelectFolderDialog", 
  1929.                 "-unused |Please choose a folder where you want to put tDohe files.|" &gInitialFolder)] 
  1930. After the dialog gFolderPath will contain the path to the selected folder.
  1931. 4/3/2000
  1932. 4:13:57 PM
  1933. TrFile-Substitutef
  1934. Troi File Plug-in
  1935. D0001 
  1936. Set Field [ result, External("TrFile-Substitute", "switches | sourceFile | destinationFile | search string | replace string" )]
  1937. Substitutes every occurrence of a specified set of characters in a (text) file with another set of characters you specify, and writes the revised file. The Substitute function is case sensitive.
  1938. switches:     these determine how the function works. At the moment you can specify how 
  1939.         the function handles case differences.
  1940. sourceFile:     the Filespec or path to the file which is the source for the substitution.
  1941. destinationFile: the Filespec or path where the resulting file must be written to.
  1942. search string:    any text expression or field containing text.
  1943. replace string:    any text expression or field containing text.
  1944. switches can be one of the following:
  1945. -CaseSensitive        substitute stringsBm only if the case of the source string is the same.
  1946. -IgnoreCase        substitute strings even if the case differs.
  1947.     Set Field[result, External("TrFile-Substitute", 
  1948.                                 "-IgnoreCase |C:\Data\temp.tab|C:\Main.TAB|country|world")] 
  1949. This will create the file "C:\Main.TAB" where all occurences of "country" are replaced with the string "world". The case is ignored, so that also a string "Country" will be substituted.
  1950. EXAMPLE 2
  1951. We assume that in your FileMaker file the following fields are defined:
  1952.     gErrorCode        Global, number            gSearchStr    Global, text
  1953.     gSourceFilePa
  1954. th    Global, text            gReplaceStr    Global, text
  1955.     gDestFilePath       Global, text
  1956. gSourceFilePath should contain the path to an existing file, for example "D:\TempLogs\Log01.TXT" (Windows) or "Mac HD:TempLogs:Log 1" (Mac).  
  1957. gDestFilePath should contain the path to the destination and should not exist, for example "D:\Output\L2000_01.TXT" (Windows) or "Mac HD:Output:Log 2000_01" (Mac). In ScriptMaker add the following scriptstep:
  1958.     Set Field[gErrorCode, External("TrFile-Substitute",  "-Case
  1959. Sensitive|" & gSourceFilePath &
  1960.              "|" & gDestFilePath & "|" & gSearchStr & "|" & gReplaceStr )]
  1961. This will create a new file gDestFilePath where all occurences of gSearchStr are replaced with the contents of  gReplaceStr.
  1962. The returned result is an error code. An error always starts with 2 dollars, followed by the error code. You should always check for errors. Returned error codes can be:
  1963.     0    no error      The destination file with the substitutions was created.
  1964.     $$-43     fnfErr          Source file not found, or destination directory does not exist
  1965.     $$-48      dupFNErr      Destination file already exists
  1966.     $$-1      genericErr      The substitution could not be made.
  1967. Other errors may be returned.
  1968. Substitutes every occurrence of a specified set of characters in a (text) file with another set of characters you specify, and writes the revised file. The Substitute function is case sensitive.
  1969. ** switches:     these determine how the function works. At the moment you can specify how 
  1970.         the function handles case differences.
  1971. sourceFile:     the Filespec or path to the file which is the source for the substitution.
  1972. destinationFile: the Filespec or path where the resulting file must be written to
  1973. search string:    any text expression or field containing text.
  1974. replace string:    any text expression or field containing text.
  1975. switches can be one of the following:
  1976. -CaseSensitive        substitute strings only if the case of the source string is the same.
  1977. -IgnoreCase        substitute strings even if the case differs.
  1978. ** The returned result is an error code. An error always starts with 2 dollars, followed by the error code. You should always check for errors. Returned error codes can be:
  1979.     0    no error  
  1980.     The destination file with the substitutions was created.
  1981.     $$-43     fnfErr          Source file not found, or destination directory does not exist
  1982.     $$-48      dupFNErr      Destination file already exists
  1983.     $$-1      genericErr      The substitution could not be made.
  1984. Other errors may be returned.
  1985. **     Set Field[result, External("TrFile-Substitute", 
  1986.                                 "-IgnoreCase |C:\Data\temp.tab|C:\Main.TAB|country|world")] 
  1987. This will create the file "C:\Main.TAB" where all occurences 
  1988. of "country" are replaced with the string "world". The case is ignored, so that also a string "Country" will be substituted.
  1989. EXAMPLE 2
  1990. We assume that in your FileMaker file the following fields are defined:
  1991.     gErrorCode        Global, number            gSearchStr    Global, text
  1992.     gSourceFilePath    Global, text            gReplaceStr    Global, text
  1993.     gDestFilePath       Global, text
  1994. gSourceFilePath should contain the path to an existing file, for example "D:\TempLogs\Log01.TXT" (Windows) or "Mac HD:TempLogs:Log
  1995.  1" (Mac).  
  1996. gDestFilePath should contain the path to the destination and should not exist, for example "D:\Output\L2000_01.TXT" (Windows) or "Mac HD:Output:Log 2000_01" (Mac). In ScriptMaker add the following scriptstep:
  1997.     Set Field[gErrorCode, External("TrFile-Substitute",  "-CaseSensitive|" & gSourceFilePath &
  1998.              "|" & gDestFilePath & "|" & gSearchStr & "|" & gReplaceStr )]
  1999. This will create a new file gDestFilePath where all occurences of gSearchStr are replaced with the contents oF
  2000. f  gReplaceStr.
  2001. 4/3/2000
  2002. 4:13:57 PM
  2003. TrFile-UnmountDiskf
  2004. Troi File Plug-in
  2005. J@Set Field [ result, External("TrFile-UnmountDisk", "diskname" )]
  2006. K2Unmounts and ejects a removable disk. Mac OS only.
  2007. M.diskname   the name of the disk to be ejected.
  2008. Set Field[result, External("TrFile-UnmountDisk", "Mac HD:" )]
  2009. This will eject the hard disk "Mac HD", provided it is not the startup disk.
  2010. EXAMPLE 2
  2011. We assume that in your FileMaker file the following fields are defined:
  2012.   gErrorCode        Global, number
  2013.   gDiskName        Global, text
  2014. gFilePath should contain the path to the disk, for example "Archive CD:" (Mac). In ScriptMaker add the following script step:
  2015.     Set Field[gErrorCode, External("TrFile-UnmountDisk", gDiskName )]
  2016. This will ejectB! the disk specified by gDiskName.
  2017. The returned result is an error code. An error always starts with 2 dollars, followed by the error code. You should always check for errors. Returned error codes can be:
  2018.     0    no error      The disk was ejected.
  2019.     $$-35     nsVolErr    No such volume (Wrong disk name or not mounted).
  2020.     $$-47    fBsyErr    File is busy, 
  2021.     $$-5010 afpFileBusy    Can't eject as the disk is being shared.
  2022. Other errors may be returned.
  2023. R$Best to use only on Ejectable Disks.
  2024. Unmounts and ejects a removable disk. Mac OS only.
  2025. ** diskname   the name of the disk to be ejected.
  2026. ** The returned result is an error code. An error always starts with 2 dollars, followed by the error code. You should always check for errors. Returned error codes can be:
  2027.     0    no error      The disk was ejected.
  2028.     $$-35     nsVolErr    No such volume (Wrong disk name or not mounted).
  2029.     $$-47    fBsyErr    File is busy, 
  2030.     $$-5010 afpFileBusy    Can't eject as the disk is being shared.
  2031. Other errors may be retur
  2032. ** Best to use only on Ejectable Disks.
  2033. ** Set Field[result, External("TrFile-UnmountDisk", "Mac HD:" )]
  2034. This will eject the hard disk "Mac HD", provided it is not the startup disk.
  2035. EXAMPLE 2
  2036. We assume that in your FileMaker file the following fields are defined:
  2037.   gErrorCode        Global, number
  2038.   gDiskName        Global, text
  2039. gFilePath should contain the path to the disk, for example "Archive CD:" (Mac). In ScriptMaker add the following script step:
  2040.     Set Field[gErrorCode, External("Tr
  2041. TCUFile-UnmountDisk", gDiskName )]
  2042. This will eject the disk specified by gDiskName.
  2043. 4/3/2000
  2044. 4:13:57 PM
  2045. TrFile-ListDisksf
  2046. Troi File Plug-in
  2047. J6Set Field [ result, External("TrFile-ListDisks", "" )]
  2048. K1Lists the names of all currently available disks.
  2049. none, leave blank
  2050. Set Field[result, External("TrFile-ListDisks", "" )]
  2051. This will return a list of names of all the disks that are currently mounted, for example:
  2052.     SPOCK
  2053.     Fotos tm 990926
  2054.     Fotos tm 991115
  2055. OGdisknames    a list of names of all the disks that are currently mounted.
  2056. `Lists the names of all currently available disks.
  2057. ** none, leave blank
  2058. ** disknames    a list of names of all the disks that are currently mounted.
  2059. ** Set Field[result, External("TrFile-ListDisks", "" )]
  2060. This will return a list of names of all the disks that are currently mounted, for example:
  2061.     SPOCK
  2062.     Fotos tm 990926
  2063.     Fotos tm 991115
  2064. 4/3/2000
  2065. 4:13:57 PM
  2066. TrFile-MetaDataf
  2067. Troi File Plug-in
  2068. JDSet Field [ result, External("TrFile-MetaData", "switch|FileSpec" )]
  2069. Gets metadata out of a graphic file. Metadata can be inserted by for example Photoshop, and can contain a description of the image, copyright information, etc.
  2070. Mswitches:     these determine the metadata that is returned.
  2071. FileSpec:     the FileSpec or path to the file
  2072. switches can be one or more of the following:
  2073. -getIPTC         get the IPTC metadata (Photoshop's File Info)
  2074. -getExif         get the Exif metadata (A standard for Digital camera's)
  2075. -getJPEGComment    get the JPEG comment metadata of a JPEG file
  2076. N5External("TrFile-MetaData", "-getIPTC |" & gFilePath)
  2077. O/metadata    the requested metadata, if available.
  2078. Note that the data is returned in a raw form. At this moment we are still working on this. email us if you want more info on this.
  2079. Gets metadata out of a graphic file. Metadata can be inserted by for example Photoshop, and can contain a description of the image, copyright information, etc.
  2080. ** switches:     these determine the metadata that is returned.
  2081. FileSpec:     the FileSpec or path to the file
  2082. switches can be one or more of the following:
  2083. -getIPTC         get the IPTC metadata (Photoshop's File Info)
  2084. -getExif         get the Exif metadata (A standard for Digital camera's)
  2085. -getJPEGComment    get the JPEG comment metadata of a JPEG fiB
  2086. ** metadata    the requested metadata, if available.
  2087. ** Note that the data is returned in a raw form. At this moment we are still working on this. email us if you want more info on this.
  2088. ** External("TrFile-MetaData", "-getIPTC |" & gFilePath)
  2089. 4/3/2000
  2090. 4:13:57 PM
  2091. TrFile-Controlf
  2092. Troi File Plug-in
  2093. JFSet Field [ result, External("TrFile-Control", "switches |password" )]
  2094. Controls the functions of the plug-in. You can disable and enable the functions of the plug-in. This allows you to create powerful solutions, without the risk of users misusing the functions, causing unwanted or harmful results.
  2095. switches:    these determine how the function works. You can disable or enable all functions.
  2096. password:    the password to be used.
  2097. switches can be one of the following:
  2098. -disableAllFunctions     allow the user no acces to functions
  2099. -enableAllFunctions    allow the user acces to all functions
  2100.     Set Field[result, External("TrFile-Control", "-disableAllFunctions |secret password")] 
  2101. This will disable the functions of the plug-in.
  2102. EXAMPLE 2
  2103. We assume that in your FileMaker file the following fields are defined:
  2104.     gErrorCode        Global, number    
  2105.     gPassword        Global, text
  2106. gPassword should contain a password, for example "rapunsel". In ScriptMaker add the following to the startup script:
  2107.      Set Field[gErrorCode, External("TrFile-Control",  "-disableAllFunctions|" & gPasswor
  2108. This will disable the plug-in function. When you want to use the plug-in add the following script steps:
  2109.     Set Field[gErrorCode, External("TrFile-Control",  "-enableAllFunctions|" & gPassword)]
  2110.     ... add powerful functions here...
  2111.    Set Field[gErrorCode, External("TrFile-Control",  "-disableAllFunctions|" & gPassword)]
  2112. This will temporary enable the plug-in functions. 
  2113. sThe returned result is an error code. An error always starts with 2 dollars, followed by the error code. You should always check for errors. Returned error codes can be:
  2114.     0        no error      
  2115.     $$-4217    pwdAlreadySet        password already set (enable first)
  2116.     $$-4218    alreadyEnabled        functions are already enabled
  2117.     $$-4219    pwdWrong        password was wrong
  2118.  Other errors may be returned.
  2119. RHWhen you call a disabled function an error code of $$-4220 is returned.
  2120. Controls the functions of the plug-in. You can disable and enable the functions of the plug-in. This allows you to create powerful solutions, without the risk of users misusing the functions, causing unwanted or harmful results.
  2121. ** switches:    these determine how the function works. You can disable or enable all functions.
  2122. password:    the password to be used.
  2123. switches can be one of the following:
  2124. -disableAllFunctions     allow the user no acces to functions
  2125. -enableAllFunctions    allow the user acc
  2126. es to all functions
  2127. ** The returned result is an error code. An error always starts with 2 dollars, followed by the error code. You should always check for errors. Returned error codes can be:
  2128.     0        no error      
  2129.     $$-4217    pwdAlreadySet        password already set (enable first)
  2130.     $$-4218    alreadyEnabled        functions are already enabled
  2131.     $$-4219    pwdWrong        password was wrong
  2132.  Other errors may be returned.
  2133. ** When you call a disabled function an error code of $$-4220 is returned.
  2134. **     Set Field[resu
  2135. lt, External("TrFile-Control", "-disableAllFunctions |secret password")] 
  2136. This will disable the functions of the plug-in.
  2137. EXAMPLE 2
  2138. We assume that in your FileMaker file the following fields are defined:
  2139.     gErrorCode        Global, number    
  2140.     gPassword        Global, text
  2141. gPassword should contain a password, for example "rapunsel". In ScriptMaker add the following to the startup script:
  2142.      Set Field[gErrorCode, External("TrFile-Control",  "-disableAllFunctions|" & gPassword)]
  2143. This will dis
  2144. qable the plug-in function. When you want to use the plug-in add the following script steps:
  2145.     Set Field[gErrorCode, External("TrFile-Control",  "-enableAllFunctions|" & gPassword)]
  2146.     ... add powerful functions here...
  2147.    Set Field[gErrorCode, External("TrFile-Control",  "-disableAllFunctions|" & gPassword)]
  2148. This will temporary enable the plug-in functions. 
  2149. 4/3/2000
  2150. 4:13:56 PM
  2151. TrFile-ConvertToFMTextf
  2152. Troi File Plug-in
  2153. J@Set Field [ result, External("TrFile-ConvertToFMText", "text" )]
  2154. Converts text formatted in the format of the current operating system running on this computer to text formatted in the internal FileMaker format. On Windows the High ASCII characters (128-255) are not the same as stored internally in FileMaker. 
  2155. text:    the text in the native format of the operating system of this computer. This will be Windows format on Windows and Mac OS format on Mac OS.
  2156. Assume that on Windows we have the file "HighText.Doc", which contains the text "Bj
  2157. rn, <CR><LF>M
  2158. nchenstra
  2159. e 2".  Add this scritstep:
  2160.     Set Field[result, External("TrFile-ConvertToFMText", External("TrFile-GetContents", "C:\HighText.Doc"))]
  2161. This will store the contents of the "HighText.Doc" in the result field, with the high ASCII characters converted to the internal FileMaker format. In the result field this will look like this:
  2162.     Bj
  2163.     M
  2164. nchenstra
  2165. EXAMPLE 2
  2166. We assum
  2167. e that in your FileMaker file the following fields are defined:
  2168.     contents        text
  2169.     gFileSpec        Global, text
  2170. gFileSpec should contain the path to an existing file, for example "D:\Readme.txt" (Windows) or "Mac HD:Readme.txt" (Mac). In ScriptMaker add the following script step:
  2171.     Set Field[contents, External("TrFile-GetContents", gFileSpec)]
  2172.     ## now the contents field is in the format of the operating system
  2173.     Set Field[contents, External("TrFile-ConvertToFMText", contents)]
  2174. s will get the contents of the file into the contents field. In the second step the high ASCII characters will be converted to the internal FileMaker format. This will work transparant on both  Mac OS and Windows.
  2175. O&The text in internal FileMaker format.
  2176. This function also converts line endings to the internal format. On Windows lines end with the two ASCII characters <CR><LF>. This is converted to the single character <CR> as used by the internal FileMaker format.
  2177. Converts text formatted in the format of the current operating system running on this computer to text formatted in the internal FileMaker format. On Windows the High ASCII characters (128-255) are not the same as stored internally in FileMaker. 
  2178. ** text:    the text in the native format of the operating system of this computer. This will be Windows format on Windows and Mac OS format on Mac OS.
  2179. ** The text in internal FileMaker format.
  2180. ** This function also converts line endings to the inter
  2181. nal format. On Windows lines end with the two ASCII characters <CR><LF>. This is converted to the single character <CR> as used by the internal FileMaker format.
  2182. ** Assume that on Windows we have the file "HighText.Doc", which contains the text "Bj
  2183. rn, <CR><LF>M
  2184. nchenstra
  2185. e 2".  Add this scritstep:
  2186.     Set Field[result, External("TrFile-ConvertToFMText", External("TrFile-GetContents", "C:\HighText.Doc"))]
  2187. This will store the contents of the "HighText.Doc" in the result field, with the hi
  2188. gh ASCII characters converted to the internal FileMaker format. In the result field this will look like this:
  2189.     Bj
  2190.     M
  2191. nchenstra
  2192. EXAMPLE 2
  2193. We assume that in your FileMaker file the following fields are defined:
  2194.     contents        text
  2195.     gFileSpec        Global, text
  2196. gFileSpec should contain the path to an existing file, for example "D:\Readme.txt" (Windows) or "Mac HD:Readme.txt" (Mac). In ScriptMaker add the following script step:
  2197.     Set Field[contents, External("TrFile-GetCon
  2198. ~tents", gFileSpec)]
  2199.     ## now the contents field is in the format of the operating system
  2200.     Set Field[contents, External("TrFile-ConvertToFMText", contents)]
  2201. This will get the contents of the file into the contents field. In the second step the high ASCII characters will be converted to the internal FileMaker format. This will work transparant on both  Mac OS and Windows.
  2202. 4/3/2000
  2203. 4:13:56 PM
  2204. TrFile-ConvertFromFMTextf
  2205. Troi File Plug-in
  2206. JBSet Field [ result, External("TrFile-ConvertFromFMText", "text" )]
  2207. Converts text formatted in the internal FileMaker format to text formatted in the format of the current operating system running on this computer. On Windows the High ASCII characters (128-255) are not the same as stored internally in FileMaker.
  2208. M+text:    the text in internal FileMaker format
  2209. Assume that on Windows we want to create the file "HighText.Doc", which contains the text "Bj
  2210. rn, <CR><LF>M
  2211. nchenstra
  2212. e 2".  Add this scritstep:
  2213.     Set Field[result, External("TrFile-ConvertFromFMText", "Bj
  2214. nchenstra
  2215. e 2")]
  2216. The result will look like: 
  2217. nchenstra
  2218. e 2". 
  2219. This may look wrong, but when you use for exampe the SetContents function it will appear correct on file.
  2220. EXAMPLE 2
  2221. We assume that in your FileMaker file the following fields are defined:
  2222.     content
  2223. s        text
  2224.     gErrorCode        Global, number
  2225.     gOutputFile        Global, text
  2226.     gContentsConverted    Global, text
  2227. gOutputFile should contain the path to a non-existing file, for example "D:\Out.txt" (Windows) or "Mac HD:Out.txt" (Mac). In ScriptMaker add the following script steps:
  2228.     Set Field[gContentsConverted, External("TrFile-ConvertFromFMText", contents)]
  2229.    ## now gContentsConverted is in the format of the operating system
  2230.     Set Field[gErrorCode,  External("TrFile-CreateFile", gOutputFi
  2231.     Set Field[gErrorCode,  External("TrFile-SetDefaultFileSpec", gOutputFile)]
  2232.     If [gErrorCode = 0 ]
  2233.         Set Field[gErrorCode, External("TrFile-SetContents", gContentsConverted)]
  2234.     Endif
  2235. This will get the contents of the contents field into the file . In the first step the high ASCII characters will be converted from the internal FileMaker format. This will work transparant on both  Mac OS and Windows.
  2236. The text in the native format of the operating system of this computer. This will be Windows format on Windows and Mac OS format on Mac OS.
  2237. This function also converts line endings. In the internal FileMaker format (and on Mac) lines end with a single <CR> character.  On Windows this function will replace all CR's to the normal line ending on Windows, the two characters <CR><LF>. 
  2238. Note: For long texts the result can be longer than the maximum number of characters (64000). In this case the function will truncate the length to 64000 characters.
  2239. Converts text formatted in the internal FileMaker format to text formatted in the format of the current operating system running on this computer. On Windows the High ASCII characters (128-255) are not the same as stored internally in FileMaker.
  2240. ** text:    the text in internal FileMaker format
  2241. ** The text in the native format of the operating system of this computer. This will be Windows format on Windows and Mac OS format on Mac OS.
  2242. ** This function also converts line endings. In the intern
  2243. al FileMaker format (and on Mac) lines end with a single <CR> character.  On Windows this function will replace all CR's to the normal line ending on Windows, the two characters <CR><LF>. 
  2244. Note: For long texts the result can be longer than the maximum number of characters (64000). In this case the function will truncate the length to 64000 characters.
  2245. ** Assume that on Windows we want to create the file "HighText.Doc", which contains the text "Bj
  2246. rn, <CR><LF>M
  2247. nchenstra
  2248. e 2".  Add this sc
  2249. ritstep:
  2250.     Set Field[result, External("TrFile-ConvertFromFMText", "Bj
  2251. nchenstra
  2252. e 2")]
  2253. The result will look like: 
  2254. nchenstra
  2255. e 2". 
  2256. This may look wrong, but when you use for exampe the SetContents function it will appear correct on file.
  2257. EXAMPLE 2
  2258. We assume that in your FileMaker file the following fields are defined:
  2259.     contents        text
  2260.     gErrorCode        Global, number
  2261.     gOutputFile        Global, text
  2262.     gContentsConverted    Global, text
  2263. gOutputFile should contain the
  2264.  path to a non-existing file, for example "D:\Out.txt" (Windows) or "Mac HD:Out.txt" (Mac). In ScriptMaker add the following script steps:
  2265.     Set Field[gContentsConverted, External("TrFile-ConvertFromFMText", contents)]
  2266.    ## now gContentsConverted is in the format of the operating system
  2267.     Set Field[gErrorCode,  External("TrFile-CreateFile", gOutputFile)
  2268.     Set Field[gErrorCode,  External("TrFile-SetDefaultFileSpec", gOutputFile)]
  2269.     If [gErrorCode = 0 ]
  2270.         Set Field[gErrorCo
  2271. "de, External("TrFile-SetContents", gContentsConverted)]
  2272.     Endif
  2273. This will get the contents of the contents field into the file . In the first step the high ASCII characters will be converted from the internal FileMaker format. This will work transparant on both  Mac OS and Windows.
  2274. 4/3/2000
  2275. 4:13:56 PM
  2276. TrFile-GetFileAttributef
  2277. Troi File Plug-in
  2278. JNSet Field [ result, External("TrFile-GetFileAttribute", "switch | FileSpec" )]
  2279. K;Returns an attribute of the file specified by the FileSpec.
  2280. switch:     this determines the attribute that is returned.
  2281. FileSpec:     the FileSpec or path to the file.
  2282. switch can be one of the following:
  2283. -lockAttr    return number indicating whether the file is locked (Mac) or Read-only (Windows)
  2284. -hiddenAttr     return number indicating whether the file is hidden (invisible)
  2285. -archiveAttr    return number indicating whether the file's archive bit is set (Windows only)
  2286.     Set Field[result, External("TrFile-GetFileAttribute", "-lockAttr| C:\test.doc")]
  2287. The result will be 1 if the file is Read-Only and 0 otherwise.
  2288. EXAMPLE 2
  2289. We assume that in your FileMaker file the following fields are defined:
  2290.     locked        text
  2291.     fileSpec        text
  2292. "fileSpec" should contain the path to an existing file, for example "D:\Out.txt" (Windows) or "Mac HD:Out.txt" (Mac). In ScriptMaker add the following script step:
  2293.     Set Field[locked, External("TrFile-GetFileAttribute", 
  2294. NBb"-lockAttr|" & fileSpec)]
  2295. This will get the locked status of the file into the field "locked".
  2296. The returned result is the requested attribute of the file. 
  2297. Result for switch "-lockAttr":     
  2298. Returns 1 for a locked file and 0 for an unlocked file. On Windows it returns the equivalent "Read-only"-attribute: 1 if the file is a Read-only file and 0 otherwise.
  2299. Result for switch "-hiddenAttr":
  2300. Returns 1 if the file is hidden and 0 otherwise. 
  2301. Result for switch "-archiveAttr":
  2302. Returns 1 if the file's archive bit is set and 0 otherwise. This bit is only available on Windows. On Mac OS this
  2303. W switch always returns 0.
  2304. Note that also an error code might be returned. An error always starts with 2 dollars, followed by the error code. Returned error codes can be:
  2305.     $$-43     fnfErr          File not found, check if the path is valid
  2306.     $$-1      genericErr      The file could not be found (older versions of the plug-in)
  2307. Other errors may be returned.
  2308. Returns an attribute of the file specified by the FileSpec.
  2309. ** switch:     this determines the attribute that is returned.
  2310. FileSpec:     the FileSpec or path to the file.
  2311. switch can be one of the following:
  2312. -lockAttr    return number indicating whether the file is locked (Mac) or Read-only (Windows)
  2313. -hiddenAttr     return number indicating whether the file is hidden (invisible)
  2314. -archiveAttr    return number indicating whether the file's archive bit is set (Windows only)
  2315. ** The returned result is the re
  2316. quested attribute of the file. 
  2317. Result for switch "-lockAttr":     
  2318. Returns 1 for a locked file and 0 for an unlocked file. On Windows it returns the equivalent "Read-only"-attribute: 1 if the file is a Read-only file and 0 otherwise.
  2319. Result for switch "-hiddenAttr":
  2320. Returns 1 if the file is hidden and 0 otherwise. 
  2321. Result for switch "-archiveAttr":
  2322. Returns 1 if the file's archive bit is set and 0 otherwise. This bit is only available on Windows. On Mac OS this switch always returns 0.
  2323. te that also an error code might be returned. An error always starts with 2 dollars, followed by the error code. Returned error codes can be:
  2324.     $$-43     fnfErr          File not found, check if the path is valid
  2325.     $$-1      genericErr      The file could not be found (older versions of the plug-in)
  2326. Other errors may be returned.
  2327. **     Set Field[result, External("TrFile-GetFileAttribute", "-lockAttr| C:\test.doc")]
  2328. The result will be 1 if the file is Read-Only and 0 otherwise.
  2329. EXAMPLE 2
  2330. We assume t
  2331. hat in your FileMaker file the following fields are defined:
  2332.     locked        text
  2333.     fileSpec        text
  2334. "fileSpec" should contain the path to an existing file, for example "D:\Out.txt" (Windows) or "Mac HD:Out.txt" (Mac). In ScriptMaker add the following script step:
  2335.     Set Field[locked, External("TrFile-GetFileAttribute", "-lockAttr|" & fileSpec)]
  2336. This will get the locked status of the file into the field "locked".
  2337. 4/3/2000
  2338. 4:13:56 PM
  2339. TrFile-SetFileAttribute
  2340. Troi File Plug-in
  2341. JNSet Field [ result, External("TrFile-SetFileAttribute", "switches|FileSpec" )]
  2342. K8Sets an attribute of the file specified by the FileSpec.
  2343. switches:     these determine the attribute that is set.
  2344. FileSpec:     the FileSpec or path to the file.
  2345. switches can be one ore more of the following:
  2346. -lock       make the file locked (Mac OS) or Read-only (Windows)
  2347. -unlock    make the file unlocked (Mac OS) or remove the Read-only attribute (Windows)
  2348. -hide        make the file hidden (invisible)
  2349. -unhide    unhide the file (visible)
  2350. -setArchive         set the file's archive bit (Windows only) 
  2351. -resetArchive      reset the file's archive bit (Windows only)
  2352.     Set Field[result, External("TrFile-SetFileAttribute", "-lock|C:\test.doc")]
  2353. The file will be locked (made Read-Only) and the result will be 0 (provided the file exists).
  2354. EXAMPLE 2
  2355. We assume that in your FileMaker file the following fields are defined:
  2356.     gFileSpec        Global, text
  2357.     gLockIt        Global, number  (used as a boolean value)
  2358.     gErrorCode        Global, number
  2359. gFileSpec should contain the path to an existing file, for example "D:\Out.txt" (Windows) or "Mac HD:Out.txt" (Mac). InB
  2360.  ScriptMaker add the following script step:
  2361.     Set Field[gErrorCode, External("TrFile-SetFileAttribute", 
  2362.                  If (gLockIt = 1, "-lock","-unlock") & "|" & gFileSpec)]
  2363. This will make the file locked if gLockIt is 1 and unlocked otherwise.
  2364. The returned result is an error code. An error always starts with 2 dollars, followed by the error code. You should always check for errors. Returned error codes can be:
  2365.     0    no error      The attribute was set.
  2366.     $$-43     fnfErr          File not found.
  2367.     $$-50      paramErr      There was an error with the parameter. 
  2368.     $$-1      genericErr    An unspecified error occurred.    
  2369. Other errors may be returned. 
  2370. RnYou'll get a parameter error ($$-50) if you try to do opposite actions at the same time, like "-unlock -lock".
  2371. Sets an attribute of the file specified by the FileSpec.
  2372. ** switches:     these determine the attribute that is set.
  2373. FileSpec:     the FileSpec or path to the file.
  2374. switches can be one ore more of the following:
  2375. -lock       make the file locked (Mac OS) or Read-only (Windows)
  2376. -unlock    make the file unlocked (Mac OS) or remove the Read-only attribute (Windows)
  2377. -hide        make the file hidden (invisible)
  2378. -unhide    unhide the file (visible)
  2379. -setArchive         set the file's archive bit (Windows only) 
  2380. etArchive      reset the file's archive bit (Windows only)
  2381. ** The returned result is an error code. An error always starts with 2 dollars, followed by the error code. You should always check for errors. Returned error codes can be:
  2382.     0    no error      The attribute was set.
  2383.     $$-43     fnfErr          File not found.
  2384.     $$-50      paramErr      There was an error with the parameter. 
  2385.     $$-1      genericErr    An unspecified error occurred.    
  2386. Other errors may be returned. 
  2387. ** You'll get a parameter error ($$-50) if you try 
  2388. to do opposite actions at the same time, like "-unlock -lock".
  2389. **     Set Field[result, External("TrFile-SetFileAttribute", "-lock|C:\test.doc")]
  2390. The file will be locked (made Read-Only) and the result will be 0 (provided the file exists).
  2391. EXAMPLE 2
  2392. We assume that in your FileMaker file the following fields are defined:
  2393.     gFileSpec        Global, text
  2394.     gLockIt        Global, number  (used as a boolean value)
  2395.     gErrorCode        Global, number
  2396. gFileSpec should contain the path to an existing file
  2397. 9, for example "D:\Out.txt" (Windows) or "Mac HD:Out.txt" (Mac). In ScriptMaker add the following script step:
  2398.     Set Field[gErrorCode, External("TrFile-SetFileAttribute", 
  2399.                  If (gLockIt = 1, "-lock","-unlock") & "|" & gFileSpec)]
  2400. This will make the file locked if gLockIt is 1 and unlocked otherwise.
  2401. 4/3/2000
  2402. 4:13:57 PM
  2403. TrFile-GetPathTof
  2404. Troi File Plug-in
  2405. JUSet Field [ result, External("TrFile-GetPathTo", "switch|desiredFilename|fileSize" )]
  2406. KIReturns the path to an object, at the moment the path to the currentFile.
  2407. switch:         this determines which path is returned
  2408. desiredFilename:     the name of the file to find
  2409. fileSize:        the size of the file to find
  2410. switch can be only the following:
  2411. -currentFileName    return the FileSpec of the file that is currently active (the front window).
  2412. Set Field [result, External("TrFile-GetPathTo",  
  2413.              "-currentFileName |" & Status(CurrentFileName) &"|"& Status(CurrentFileSize))]
  2414. FileSpec:     The function returns a FileSpec for the current database file.
  2415. the function can also return an errorcode. An error always starts with 2 dollars, followed by the error code. You should always check for errors. Returned error codes can be:
  2416.     0        no error          The attribute was set.
  2417.     $$-43         fnfErr              File not found.
  2418.     $$-50          paramErr          There was an error with the parameter. 
  2419.     $$-4215      invalidFMPVersion      This function does not work with this version 
  2420. Other errors may be returnedB3. user cancels an error code of "$$-1" is returned.
  2421. This function works on Windows from FileMaker version 5. On Mac OS it works from FileMaker 4.0 and later. If you use it on Windows under a version earlier than FileMaker 5 an error code "$$-4215" (kErrInvalidFMPVersion) is returned.
  2422. Also when a file is hosted as a guest, for example with FileMaker Server it can not return the path, in this case it will return an error code "$$-43" (fnfErr = file not found). 
  2423. Returns the path to an object, at the moment the path to the currentFile.
  2424. ** switch:         this determines which path is returned
  2425. desiredFilename:     the name of the file to find
  2426. fileSize:        the size of the file to find
  2427. switch can be only the following:
  2428. -currentFileName    return the FileSpec of the file that is currently active (the front window).
  2429. ** FileSpec:     The function returns a FileSpec for the current database file.
  2430. the function can also return an errorcode. An error always starts with 2 d
  2431. ollars, followed by the error code. You should always check for errors. Returned error codes can be:
  2432.     0        no error          The attribute was set.
  2433.     $$-43         fnfErr              File not found.
  2434.     $$-50          paramErr          There was an error with the parameter. 
  2435.     $$-4215      invalidFMPVersion      This function does not work with this version 
  2436. Other errors may be returned. user cancels an error code of "$$-1" is returned.
  2437. ** This function works on Windows from FileMaker version 5. On Mac OS it works from FileMaker 4.0
  2438.  and later. If you use it on Windows under a version earlier than FileMaker 5 an error code "$$-4215" (kErrInvalidFMPVersion) is returned.
  2439. Also when a file is hosted as a guest, for example with FileMaker Server it can not return the path, in this case it will return an error code "$$-43" (fnfErr = file not found). 
  2440. ** Set Field [result, External("TrFile-GetPathTo",  
  2441.              "-currentFileName |" & Status(CurrentFileName) &"|"& Status(CurrentFileSize))]
  2442. 4/3/2000
  2443. 4:13:56 PM
  2444.     Open file
  2445. Set all globals
  2446. To Menu
  2447. To Overview
  2448. To Related record
  2449.     To Detail
  2450. ----- General ------
  2451. Check plug-in
  2452. ----- Documentation etc ------
  2453. Print Function Specs
  2454. Copy Parameters
  2455. Print this record
  2456. BeepBeep
  2457. create overview
  2458. Prepare for PDF
  2459. Sort on FunctionName
  2460. go to Exteral DB (online)
  2461. To Menu
  2462. Check plug-in
  2463. Set all globals
  2464.  A    Open file
  2465. ) = 2    
  2466. Print Function Specs
  2467. ) < 601    
  2468. Copy Parameters
  2469. Cancel
  2470. Do you want to copy the parameters?B+
  2471. ) = 1    
  2472. ----- General ------
  2473. ----- Documentation etc ------
  2474. Print this record
  2475. A4Important: ALWAYS check if the plug-in is available!B)Check if this is FileMaker 4.0 or higher.CQ
  2476.  1)) < 4    
  2477. Canceld
  2478. This file requires FileMaker 4.0 or higherE*Check if the Troi FM Plug-in is available.Fz
  2479. |("Troi-Version"
  2480.  "") 
  2481.  15 ) <> "Troi FM Plug-in"
  2482. Troi-Version
  2483. Troi FM Plug-in
  2484. ) = 1    
  2485. Canceld
  2486. Troi FM Plug-in not found. Please put the Troi FM Plug-in into the Extensions folder inside the FileMaker folder. 
  2487. Also enable all the plug-ins under the application preferences.
  2488. Canceld
  2489. Troi FM Plug-in not found. Please put the Troi FM Plug-in into the SYSTEM directory inside the FileMaker directory. 
  2490. Also enable all the plug-ins under the application preferences.
  2491. BeepBeep
  2492. To Overview
  2493. ) = 2    
  2494. ) > 0    
  2495. Cancel
  2496. Nothing matched your search. Do you want to search again?C+
  2497. ) = 2    
  2498. To Related record
  2499. create overview
  2500. FPTHA
  2501. Prepare for PDF
  2502. Sort on FunctionName
  2503. oA    To Detail
  2504. go to Exteral DB (online)
  2505. http://www.troi.com/reference/
  2506. % & "TAB" & 
  2507. K & "
  2508.     Helvetica
  2509. Geneva
  2510. Arial
  2511. Times New Roman
  2512. Monaco
  2513. Courier
  2514. Times
  2515. Futura
  2516. Courier New
  2517. Palatino
  2518. Chicago
  2519. VAG Rounded Black
  2520. VAG Rounded Bold
  2521. Univers 67 CondensedBold
  2522. k{k|w
  2523. [=g\gYg\.T
  2524. g\c[_]c\ozc\g\[]g\c[o{c[g\[\g\24
  2525. OYBw*
  2526. _ZkZ[ZkZ_ZkZOZkZ[ZkZ_Zw
  2527. k]k]{
  2528. g\g=5
  2529. 5sF6g]F
  2530. o|g]k}
  2531.     k]k]s
  2532. o|g]{
  2533. k]k]w
  2534. Nv_:5
  2535. g=g<_;w
  2536. o\o}5
  2537. k=JW1
  2538. o\g{1
  2539. g=k]5
  2540. NvkZ2
  2541. s}g]k\
  2542. g=g<w
  2543. g}k=o
  2544. o^k{k}
  2545. g]k=k
  2546. g}k]o}
  2547. ~ffff
  2548. ffffff
  2549. ffff33
  2550. ff33ff
  2551. ff3333
  2552. 33ffff
  2553. 33ff33
  2554. 3333ff
  2555. 333333
  2556. wwwwww
  2557. UUUUUU
  2558. DDDDDD
  2559. """"""
  2560. GRPTH
  2561. FPTHAGWORF:Projecten:Troi FM Plug-In:Troi-Text-Plug-in1.0b1:Text Examples.fp3
  2562. Text Examples.fp3
  2563. FMP3FMP3
  2564. Troi-Text-Plug-in1.0b1
  2565. GWORF:Projecten:Troi FM Plug-In:Troi-Text-Plug-in1.0b1:Text Examples.fp3
  2566. MSPCA
  2567. NAMEA
  2568. Text Examples.fp3
  2569. RPTHA
  2570. Text Examples.fp3
  2571. ZONEA
  2572.     192.1.1.2
  2573. Text Examples.fp3
  2574. FMP3FMP3
  2575. Troi-Text-Plug-in1.0b1
  2576. GWORF:Projecten:Troi FM Plug-In:Troi-Text-Plug-in1.0b1:Text Examples.fp3
  2577. YRPTH
  2578. (LIST
  2579. LISTA
  2580. VDEFA(
  2581. (LIST
  2582. VDEFA(
  2583. (LIST
  2584. LISTA
  2585. VDEFA(
  2586. PluginnamesI
  2587. FMRLA
  2588. FMRLA
  2589. AllExterns
  2590. FPTHAYKES:Projecten:Troi Plug-In 991001:Troi Plug-ins:GRAB:Troi-Grabber-Plug-in1.2:GrabExpl.fp3
  2591. MSPCA
  2592. NAMEA
  2593. GrabExpl.fp3
  2594. RPTHA
  2595. GrabExpl.fp3
  2596. GrabExpl.fp3
  2597. KFMP3FMP3
  2598. Troi-Grabber-Plug-in1.2
  2599. YKES:Projecten:Troi Plug-In 991001:Troi Plug-ins:GRAB:Troi-Grabber-Plug-in1.2:GrabExpl.fp3
  2600. McGee
  2601. peter
  2602.